SA-MP Forums Archive
[Help]: /changeskin - 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: [Help]: /changeskin (/showthread.php?tid=430877)



[Help]: /changeskin - Areax - 15.04.2013

Hello!

I have one problem :/ I have a command /changeskin [skinid], but when a player type it and then he die, then he must to type /changeskin again..How can I fix that?

PHP код:
CMD:changeskin(playeridparams[])
{
    new 
skinid;
    new 
string[160];
    if(
sscanf(params"d"skinid)) return SendClientMessage(playeridCOLOR_ORANGE"Usage: /changeskin [id]");
    if(
skinid == 268) return SendClientMessage(playeridCOLOR_RED"ERROR: You are Not Allowed To Use This Skin!");
    if(
skinid || skinid 299) return  SendClientMessage(playeridCOLOR_RED"ERROR: Invalid Skin Model! (0-299)");
    
SetPlayerSkin(playeridskinid);
    
format(stringsizeof(string), "[SYSTEM]: %s Has Changed His Skin To id %d"GetName(playerid), skinid);
    
SendClientMessageToAll(COLOR_PURPLEstring);
    return 
1;

Thanks


AW: [Help]: /changeskin - ulbi1990 - 15.04.2013

Set a variable for the skin and save the skin when the player use the command and load it when he spawns.

Example:

pawn Код:
new skin[MAX_PLAYERS];

//Your command
{
    skin[playerid]=GetPlayerSkin(playerid);
    return 1;
}

OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid,skin[playerid]);
    return 1;
}



Re: AW: [Help]: /changeskin - Areax - 15.04.2013

Quote:
Originally Posted by ulbi1990
Посмотреть сообщение
Set a variable for the skin and save the skin when the player use the command and load it when he spawns.

Example:

pawn Код:
new skin[MAX_PLAYERS];

//Your command
{
    skin[playerid]=GetPlayerSkin(playerid);
    return 1;
}

OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid,skin[playerid]);
    return 1;
}
Don't work...It's same.


Re: [Help]: /changeskin - RandomDude - 15.04.2013

If the player wants to change skin there is another way I can suggest click f4 and it will kill him and he can choose skin again just saying...


AW: Re: [Help]: /changeskin - ulbi1990 - 15.04.2013

Quote:
Originally Posted by RandomDude
Посмотреть сообщение
If the player wants to change skin there is another way I can suggest click f4 and it will kill him and he can choose skin again just saying...
You didn't had read his issue. So please shut up and spam somewhere else.

@Topic starter.

Can you show use please how you used what i wrote?


Re: [Help]: /changeskin - Areax - 15.04.2013

Quote:
Originally Posted by RandomDude
Посмотреть сообщение
If the player wants to change skin there is another way I can suggest click f4 and it will kill him and he can choose skin again just saying...
I am creating TDM server, not stunt server...


Re: [Help]: /changeskin - RandomDude - 15.04.2013

Quote:

CMDkin(playerid, params[])
{
new
skinid,
msg[80];

if(sscanf(params, "d", skinid))return SendClientMessage(playerid, COLOR_GREY, "USAGE: /skin [skinid]");

else if(!IsValidSkin(skinid)) return SendClientMessage(playerid, COLOR_GREY, "Invalid Skin ID!");

else if(IsValidSkin(skinid)) {
SetPlayerSkin(playerid, skinid);
format(msg, sizeof(msg), "You have changed your skin to skin ID %i.", skinid);
SendClientMessage(playerid, COLOR_GREY, msg);
}
return 1;
}

Try this then


Re: [Help]: /changeskin - Xoomer - 15.04.2013

try this
pawn Код:
CMD:setskin(playerid, params[])
{
    new level, id;
    new skinid;
    new string[128];
    if(sscanf(params, "dd", id, level)) return SendClientMessage(playerid, WHITE, "{FF0000}USAGE:{FFFFFF}  /setskin [playerid] [skin id]");
    {
    if(skinid == 268) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are Not Allowed To      Use This Skin!");
    if(level > 299 || level < 1) return SendClientMessage(playerid, GREY, "Invalid skin ID!");
    SetPlayerSkin(id, level);
    format(string, sizeof(string), "[SYSTEM]: %s Has Changed His Skin To id %d", GetName(playerid),  skinid);
    SendClientMessageToAll(COLOR_PURPLE, string);
    }
         
    return 1;
}