16.10.2014, 17:38
Hey i have made duel system but he always shows one msg 'You cannot duel yourself!'
I show you cmd cods
I show you cmd cods
pawn Код:
CMD:duel(playerid, params[]) {
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /duel [ID] [Weapon].");
if(!strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE: /duel [ID] [Weapon].");
new id;
if(!IsPlayerConnected(id))return SendClientMessage(playerid, red, "Player is not connected.");
if(DND[id] == 1)return SendClientMessage(playerid, red, "Player is in DND mode.");
if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid, red, "You're jailed and can't send duel requests.");
if(PlayerInfo[id][Jailed] == 1) return SendClientMessage(playerid, red, "Target is jailed, you can't send him duel requests.");
if(PlayerInfo[id][OnDuty] == 1)return SendClientMessage(playerid, red, "Player is on admin duty.");
if(playerid == id)return SendClientMessage(playerid, red, "You cannot duel yourself!");
if(dueling[id] == 1)return SendClientMessage(playerid, red, "Player is already dueling!");
new wep[30];
new wepid = GetWeaponIDFromName(wep);
if(wepid == -1)return SendClientMessage(playerid, red, "That weapon doesn't exist.");
if(wepid == 38)return SendClientMessage(playerid, red, "You cannot duel with a minigun!");
if(wepid == 44)return SendClientMessage(playerid, red, "You cannot duel with this weapon!");
if(wepid == 45)return SendClientMessage(playerid, red, "You cannot duel with this weapon!");
if(wepid == 43)return SendClientMessage(playerid, red, "You cannot duel with a camera!");
if(wepid == 0)return SendClientMessage(playerid, red, "Invalid weapon!");
DuelInfo[id][playa] = playerid;
DuelInfo[id][weapon] = wepid;
new playermsg[128];
new string[128];
format(playermsg, 255, "%s has requested to duel %s. Weapon: %s.",PlayerName2(playerid),PlayerName2(id),wep);
SendClientMessage(playerid, COLOR_YELLOW, playermsg);
SendClientMessage(id, COLOR_YELLOW, playermsg);
ShowPlayerDialog(id,DIALOG_DUEL,DIALOG_STYLE_MSGBOX,"Duel",string,"Accept","Ignore");
return 1;
}