Duel.

Započeo pokerface, April 14, 2019, 14:09:55 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Imam jedan duel system. Ali kada nekome posaljem duel on mora upisati /acceptduel playerid a ja zelim samo da upise /acceptduel
Dio skripte: Dolje
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike

Komande.

[pawn]
//Duel_System
CMD:duel(playerid, params[])
{
   new duelbet, userid;
   if(sscanf(params, "ui", userid, duelbet)) return SCM(playerid, COLOR_GREY, "Usage: {FFFFFF}/duel <playerid> <bet>");
   if(userid == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Error: {FFFFFF}Player is not connected.");
   if(InDuel[playerid] == 1) return SCM(playerid, COLOR_GREY, "Error: {FFFFFF}You are already in a duel.");
   if(InDuel[userid] == 1) return SCM(playerid, COLOR_GREY, "Error: {FFFFFF}Player is already in a duel.");
   if(userid == playerid) return SendClientMessage(playerid, -1,"(ERROR): {FFFFFF}You can't duel with yourself!" );
   
   if(GetPlayerMoney(playerid) < duelbet && duelbet != 0) return SCM(playerid, -1, "* You don't have that much money!");
   if(GetPlayerMoney(userid) < duelbet && duelbet != 0) return SCM(playerid, -1, "* That player doesn't have that much amount of money!");
   if(duelbet < 0) return SCM(playerid, -1, "* Bet Range: $0-25000");
   if(duelbet > 25000) return SCM(playerid, -1, "* Bet Range: $0-25000");

   
   DuelInvite[userid] = playerid;
   DuelAccepter[playerid] = userid;
   Bet = duelbet;

   ShowPlayerDialog(playerid, DIALOG_DUEL_WEAPON, DIALOG_STYLE_LIST, "Duel System [Weapon Select]", "Desert Eagle\nM4\nShotgun\nMP5\nSniper", "Select", "");

   return 1;
}
CMD:acceptduel(playerid, params[])
{
   if(InDuel[playerid] == 1) return SCM(playerid, COLOR_GREY, "Error: {FFFFFF}You are already in a duel.");
   if(DuelInvite[playerid] == -1)return SCM(playerid, COLOR_GREY, "Error: {FFFFFF}You haven't been invited in a duel.");
   if(DuelInvite[playerid] != -1 && DuelInvite[playerid] == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Error: {FFFFFF}Player is not connected.");
   new userid, string[256];

   if(sscanf(params, "u", userid)) return SCM(playerid, COLOR_GREY, "Usage: {FFFFFF}/acceptduel <playerid>");

   if(userid != DuelInvite[playerid] ) return SCM(playerid, COLOR_GREY, "Error: {FFFFFF}You haven't been invited to duel by that player.");
   userid = DuelInvite[playerid];
   DuelInvite[playerid] = userid;
   format(string, sizeof(string), "Duel-System: {FFFFFF}%s (%d) has accepted the duel. You are being teleported in the arena.(BET: %d)", GetName(playerid), playerid, Bet);
   SCM(userid, COLOR_GREY, string);
   format(string, sizeof(string), "Duel-System: {FFFFFF}You have accepted the duel from  %s (%d). You are being teleported in the arena.(BET: %d)", GetName(userid), userid, Bet);
[/pawn]

I ovo nakon sto igrac izabere koja mapa za duel gdje se zavrsava invite.

[pawn]new string[256];
         format(string, sizeof(string), "Duel-System: {FFFFFF}%s (%d) has invited you to a duel. Usage (/acceptduel <playerid>) to accept it.", GetName(playerid), playerid);
         SCM(DuelAccepter[playerid], COLOR_GREY, string);
         format(string, sizeof(string), "Duel-System: {FFFFFF}You have invited %s (%d) to a duel.", GetName(DuelAccepter[playerid]), DuelAccepter[playerid]);
         SCM(playerid, COLOR_GREY, string);[/pawn]
You'll be always in my heart, the end and thanks for amazing times. #WeAreLords