help for skin
#1

help me please, pretend i need 3skins for a gang like id 121,122with 1cmd. if i type /oskin i get id121 skin, if i type again how do i get skin 122 then again 121
Reply
#2

Well you would simply need to track if the player typed the command before or not, for example using PVars, you could also use variables, but for simplicity in explaining this example, I'll use a PVar.

pawn Код:
if(strcmp(cmdtext,"/oskin",true) == 0)
{
    if(!GetPVarInt(playerid,"pSkinned")) // Is pSkinned PVar false? (0)
    {
        SetPlayerSkin(playerid,121);
        SetPVarInt(playerid,"pSkinned",1); // Set the PVar to one
    }
    else // PVar is not false, therefore it must be 1 (unless set to something else in the code somewhere else)
    {
        SetPlayerSkin(playerid,122);
        SetPVarInt(playerid,"pSkinned",0); // Set it to 0
    }        
    return 1;
}
Hope that helps
Reply
#3

sorry but is therer an easy tutorial to make it, im not really a professional
Reply
#4

ignore that post, i didnt know how to script good that time so i learn scripting more... thanks man
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)