Quote:
Originally Posted by thefirestate
Liam, here's your problem. If you use if(sscanf(params, "s[32]", params)) then check if the params include namechange with if(!strcmp(params, "namechange", true) it will work but once you do if(sscanf(params, "s[32]i", params, id)) the params would become namechange 1 and the only solution is checking by this way : if(!strcmp(params, "namechange", true, 9) where 9 is the string lenght.
PHP код:
CMD:accept(playerid, params[])
{
if(sscanf(params, "s[32]", params)) return SCM(playerid, COLOR_GREY, "USAGE: /accept (hire, interview, gag, tie, ticket)");
if(!strcmp(params, "namechange", true, 9))
{
if(PlayerInfo[playerid][AdminLevel] < 1) return AuthorMsg(playerid);
new id;
if(sscanf(params, "s[32]i", params, id)) return SCM(playerid, COLOR_GREY, "USAGE: /accept namechange [id]");
if(id == INVALID_PLAYER_ID) return SendClientMessageF(playerid, COLOR_GREY, "Invalid Player ID.");
if(RequestNameChange[id] != 1) return SCM(playerid, COLOR_GREY, "That player is not requesting a name change.");
|
I literally just seen this. This solution fixed it, I tried using strlen on Choice, then doing sscanf(params, "s[%d][i]", strlen(choice) etc etc, however that never worked. TheFireState has got it working. Thanks for the assistance guys, and thank you, firestate