[Help]: /changeskin
#1

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
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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...
Reply
#5

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?
Reply
#6

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...
Reply
#7

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
Reply
#8

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;
}
Reply


Forum Jump:


Users browsing this thread: