05.04.2013, 07:58
The problem is that when I challenge someone to a duel I get always the message / duel [id] what's wrong?
Код:
CMD:duel(playerid, params[])
{
GetPlayerName(playerid, pname, sizeof(pname));
format(stringu, sizeof(stringu), "{54da00}[COMANDO]{ffffff}%s (ID: %d) ha usato il cmd {ff0000}/Duel", pname, playerid);
SendClientMessageToAll(COLOR_LIGHTBLUE, stringu);
if(IsPlayerConnected(playerid))
{
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Red, "[ERRORE:]{FFFFFF} /duel [ID]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(statod[playerid] == 1 )
{
SendClientMessage(playerid,Red,"[ERRORE:]{FFFFFF} Hai giа sfidato qualcuno");
}
if(statod[playerid] == 2 )
{
SendClientMessage(playerid,Red,"[ERRORE:]{FFFFFF} Sei giа stato sfidato da qualcuno a un duello");
}
if(statod[playerid] == 3 )
{
SendClientMessage(playerid,Red,"[ERRORE:]{FFFFFF} Stai giа partecipando a un duello");
}
else if(statod[playerid] == 0 )
{
if(statod[giveplayerid] == 1 )
{
SendClientMessage(playerid,Red,"[ERRORE:]{FFFFFF} Il giocatore ha giа sfidato qualcuno a un duello");
}
if(statod[giveplayerid] == 2 )
{
SendClientMessage(playerid,Red,"[ERRORE:]{FFFFFF} Il giocatore и giа stato sfidato a un duello");
}
if(statod[giveplayerid] == 3 )
{
SendClientMessage(playerid,Red,"[ERRORE:]{FFFFFF} Il giocatore sta giа partecipando a un duello");
}
else if(statod[giveplayerid] == 0 )
{
statod[playerid] = 1;
statod[giveplayerid] = 2;
GetPlayerName(playerid,nome,sizeof(nome));
GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
format(string4,sizeof(string4),"[DUELLO:]{FFFFFF} %s ha sfidato %s a un duello", nome, giveplayer);
SendClientMessageToAll(COLOR_ORANGE,string4);
format(string4,sizeof(string4),"[DUELLO:]{FFFFFF} Hai sfidato %s a un duello, aspetta una risposta", giveplayer);
SendClientMessage(playerid, COLOR_ORANGE,string4);
sfidante[giveplayerid] = playerid;
format(string4,sizeof(string4),"[DUELLO:]{FFFFFF} Sei stato sfidato da %s a un duello, scrivi /accetta o /rifiuta", nome);
SendClientMessage(giveplayerid, COLOR_ORANGE, string4);
}
}
}
}
}
return 1;
}


