24.06.2010, 10:47
You have placed wrong numbers at strcmp.
if(!strcmp(cmdtext, "/skin ", true, 3)) <--- has 5 characters (with space), but there's only 3
if(!strcmp(cmdtext, "/skin 0", true, 3)) <--- wrong too...
if (strcmp("/skin 1", cmdtext, true, 10) == 0) <--- i think it's wrong too.
I suggest you to try to do one command within checking. Ex.:
if(!strcmp(cmdtext, "/skin ", true, 3)) <--- has 5 characters (with space), but there's only 3
if(!strcmp(cmdtext, "/skin 0", true, 3)) <--- wrong too...
if (strcmp("/skin 1", cmdtext, true, 10) == 0) <--- i think it's wrong too.
I suggest you to try to do one command within checking. Ex.:
Код:
if(!strcmp(cmdtext, "/skin", true, 4)) { if(cmdtext[3]==0) return SendClientMessage(playerid, 0xFF9900AA, "USAGE: /skin [skin id]"); new skin[11]; strmid(skin,cmdtext[5],0,11); if(!strcmp(skin,"0",true)) return SendClientMessage(playerid, 0xFF9900AA, "Invalid skin ID!"); // "0" for blank input, the problem is for cj skin new skinid = strval(skin); // check here for valid skin IDs... // and when set the skin if it's valid. SetPlayerSkin(playerid, skinid); return 1; }