SA-MP Forums Archive
[help] 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] Skin.... (/showthread.php?tid=119981)



[help] Skin.... - [eF]ThundeR - 10.01.2010

hello there,if i make /sawnoff command and teleport and i add SetPlayerSkin(playerid,55...) how i can make when the player die/leave the /sawnoff to give him back the same skin he had before joining /sawnoff


Re: [help] Skin.... - spartan1178 - 10.01.2010

I get what you mean. It teleports them to an arena, gives them a skin, and they fight with sawnoffs right? Well if so;

Try saving it into a variable, for example:

Код:
if (strcmp("/sawnoff", cmdtext, true, 10) == 0)
{
    new pskin;
    new Float:pX, Float:pY, Float:pZ;
    pskin = (GetPlayerSkin(playerid));
    GetPlayerPos(playerid,pX,pY,pZ);
    if(pArena[playerid] == NONE)
    {
        SetPlayerSkin(playerid,55);
        SetPlayerPos(playerid,1549.0627,-1675.7617,14.8003);
    }
    else
    {
        SetPlayerPos(playerid,pX,pY,pZ);
        SetPlayerSkin(playerid,pskin);
    }
    return 1;
}
NOTE: This script won't work for you, it is only a base. Some of the variables and such will need to be changed, but the idea should work.


Re: [help] Skin.... - Think - 10.01.2010

new oldskin[MAX_PLAYERS];

if(!strcmp(cmdtext, "/sawnoff", true))
{
oldskin[playerid] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 55);
return 1;
}

if(!strcmp(cmdtext, "/leave", true))
{
SetPlayerSkin(playerid, oldskin[playerid]);
return 1;
}