22.05.2013, 16:30
Hi All,
I made a 10-command for police officers but i have a problem with 2 codes.
Code 25 and 75 is for using on other players.
But when i do like /10 25 3 it sends the message to id -1.
How can i fix this?
Admigo
I made a 10-command for police officers but i have a problem with 2 codes.
pawn Код:
dcmd_10(playerid,params[])
{
new reportid,id;
if(gTeam[playerid]!=TEAM_COP)
{
SendClientMessage(playerid,COLOR_RED,"This Command is only for Law Enforcement!");
return 1;
}
if(reportid > 99 || reportid < 0)
{
SendClientMessage(playerid,COLOR_RED,"Invalid Code!");
return 1;
}
if(HasSendedRadioCode[playerid]>1)
{
SendClientMessage(playerid,COLOR_RED,"Please wait before Sending a Police Code again!");
return 1;
}
if(reportid ==25 || reportid ==75)
{
if(sscanf(params, "du", reportid,id))
{
SendClientMessage(playerid,COLOR_RED,"USAGE: /10 [25/75] [playerid]");
return 1;
}
if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid)
{
SendPlayerRadioCrimeCode(playerid,reportid,id);
HasSendedRadioCode[playerid]=15;
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"This Player is not connected");
return 1;
}
}
else
{
if(sscanf(params, "d", reportid))
{
SendClientMessage(playerid,COLOR_RED,"USAGE: /10 [0-99]");
return 1;
}
SendPlayerRadioCrimeCode(playerid,reportid,-1);
HasSendedRadioCode[playerid]=15;
}
return 1;
}
But when i do like /10 25 3 it sends the message to id -1.
How can i fix this?
Admigo