help for skin - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help for skin (
/showthread.php?tid=183826)
help for skin -
tanush - 16.10.2010
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
Re: help for skin -
JaTochNietDan - 16.10.2010
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
Re: help for skin -
tanush - 16.10.2010
sorry but is therer an easy tutorial to make it, im not really a professional
Re: help for skin -
tanush - 02.03.2011
ignore that post, i didnt know how to script good that time so i learn scripting more... thanks man