SA-MP Forums Archive
GetPlayerSkin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetPlayerSkin (/showthread.php?tid=445133)



GetPlayerSkin - Ananisiki - 19.06.2013

^^^^^^^^


Re: GetPlayerSkin - park4bmx - 19.06.2013

Remove the "!" Before IsPlayerAdmin


Re: GetPlayerSkin - Ananisiki - 19.06.2013

^^^^^^^^


Re: GetPlayerSkin - park4bmx - 19.06.2013

I got mixed upm aswell
pawn Код:
if(GetPlayerSkin(playerid) == 294 && IsPlayerAdmin(playerid)==0) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Choose This Skin.");
Which then will be the same as "!" But the condition check might not work like that


Respuesta: GetPlayerSkin - Parka - 19.06.2013

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin( playerid ) == 294 && IsPlayerAdmin(playerid))
        else return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Choose This Skin.");

    return 1;
}



Re: GetPlayerSkin - Ananisiki - 19.06.2013

^^^^^^^^


Re: GetPlayerSkin - park4bmx - 19.06.2013

Show more of the code


Re: GetPlayerSkin - Ananisiki - 19.06.2013

^^^^^^^^


Re: GetPlayerSkin - park4bmx - 19.06.2013

1) it must be an "I"integer
2) why check the skin before applying it ?
pawn Код:
CMD:skin(playerid, params[])
{
    new skinid;
    if(sscanf(params, "i", skinid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /skin (SkinID) - Enter A Valid Skin ID");
    if(skinid > 299 || skinid < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid Skin ID.");
    if(skinid == 294 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Choose This Skin.");
    SetPlayerSkin(playerid, skinid);
    return 1;
}



Respuesta: GetPlayerSkin - Parka - 19.06.2013

pawn Код:
CMD:skin(playerid, params[])
{
    new skinid;
    if(sscanf(params, "d", skinid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /skin (SkinID) - Enter A Valid Skin ID");
    if(skinid > 299 || skinid < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid Skin ID.");
    if(skinid == 294 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Choose This Skin.");
   SetPlayerSkin(playerid, skinid);
    return 1;
}