09.09.2009, 00:35
Alright, I haven't really seen anything like this code so I don't know exactly what I am doing wrong. Now here is my code
Now that code works. It allows only the player with that name to use that command.
However I have a issue. If I try
It gives me errors. Or even if I make a whole new command like this
it wont work. So basically only the first command works. Any idea why?
Код:
new playername[MAX_PLAYER_NAME]; if (strcmp("/change", cmdtext, true, 10) == 0) { GetPlayerName(playerid, playername, MAX_PLAYER_NAME); if(strcmp("Player_Name",playername, true, 10) == 0) { SetPlayerSkin(playerid, 187); return 1; } else { SendClientMessage(playerid, 0xBFC0C2FF, "Can not use this command"); return 1; } }
However I have a issue. If I try
Код:
if (strcmp("/change", cmdtext, true, 10) == 0) { GetPlayerName(playerid, playername, MAX_PLAYER_NAME); if(strcmp("Player_Name",playername, true, 10) == 0) { SetPlayerSkin(playerid, 187); return 1; } else if strcmp("Player_Two",playername, true, 10) == 0) { SetPlayerSkin(playerid, 187); return 1; } else { SendClientMessage(playerid, 0xBFC0C2FF, "Can not use this command"); return 1; } }
Код:
if (strcmp("/clothes", cmdtext, true, 10) == 0) { GetPlayerName(playerid, playername, MAX_PLAYER_NAME); if(strcmp("Player_Two",playername, true, 5) == 0) { SetPlayerSkin(playerid, 186); return 1; } else { SendClientMessage(playerid, 0xBFC0C2FF, "Can not use this command"); return 1; } }