27.12.2013, 13:31
Hi,
I had a problem with sscanf, warning about optional string. It's corrected : S(No Reason)[125]
But, my script don't work.
I write: /admin : ok : "/admin [choix]"
I write: /admin slap : not ok! : "Player not connected" (warning from InvalidPlayerID) ...
Help
Thanks
I had a problem with sscanf, warning about optional string. It's corrected : S(No Reason)[125]
But, my script don't work.
PHP код:
YCMD:admin(playerid, params[], help)
{
new tmp[20],
nextParams[125]
;
if( sscanf(params, "s[25]S(No Reason)[125]", tmp, nextParams) )
return SendClientMessage(playerid, -1, "{9DEB00}Usage: /admin [Choix]");
else
{
if( !strcmp(tmp, "slap", true) )
{
new userid,
raison[50],
Float:POS[3]
;
if( sscanf(nextParams, "uS(No Reason)[50]", userid, raison) )
return SendClientMessage(playerid, -1, "[Commande] /admin slap [ID/Partie du Nom] [Raison (facultatif)]");
else
{
if( InvalidPlayerID(playerid, userid) ) return 1;
GetPlayerPos(userid, POS[0], POS[1], POS[2]);
SetPlayerPos(userid, POS[0], POS[1], POS[2]+5);
if( strlen(raison) > 0)
SendClientMessageToAllEx(-1, "[ADMIN] L'admin %s a slap %s. Raison: %s", returnNameEx(playerid), returnNameEx(userid), raison);
else
SendClientMessageToAllEx(-1, "[ADMIN] L'admin %s a slap %s.", returnNameEx(playerid), returnNameEx(userid));
}
}
}
return 1;
}
I write: /admin slap : not ok! : "Player not connected" (warning from InvalidPlayerID) ...
Help
Thanks