18.03.2009, 02:23
Hm...I kinda changed my mind with this dcmp and used strcmp...
Here it is what I've done.
By the way. IT WORKS !!!![Cheesy](images/smilies/biggrin.png)
Here it is what I've done.
By the way. IT WORKS !!!
![Cheesy](images/smilies/biggrin.png)
pawn Код:
if(strcmp(cmd, "/setskin", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to change skins");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /setskin [player/PartOfName] [skin]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(giveplayerid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_GREY, "Invalid user or user is not online");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /setskin [player/PartOfName] [skin]");
return 1;
}
new skinid = strval(tmp);
if (skinid<0 || skinid > 299)
{
SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID, must be between 0 and 299");
return 1;
}
PlayerInfo[giveplayerid][pModel] = skinid;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s's Skin was set to %d", giveplayer, skinid);
SendClientMessage(playerid, COLOR_WHITE, string);
OnPlayerUpdate(giveplayerid);
SetPlayerSkin(giveplayerid, skinid);
return 1;
}