command wont set in pinfo
#1

I have a save skin command which when I do /skin [skinId here] it saves and load after spawn.

Код:
CMD:skin(playerid,params[])
{
    new skinid;
    if(sscanf(params, "i", skinid)) return
    SendClientMessage(playerid, white, "{FFFF00}Usage: /skin <Skin ID>") ;
    if(IsPlayerConnected(playerid))
    {
        if(skinid < 0 || skinid > 299) return SendClientMessage(playerid, red, ">> Invaild Skin ID. It nust be between <0-299>");
        GameTextForPlayer(playerid,"~g~Skin Changed",2000,3);
        pInfo[playerid][Skin] = skinid;
        SetPVarInt(playerid,"Useskin", 1);
        return SetPlayerSkin(playerid, skinid);
    }
    else return ShowMessage(playerid, red, 2);

}
and I have another skin command that use mselection.inc but when I do /skin2 it changes skin. but it doesnt set my skin after spawn to a new one.

here is the command.

Код:
CMD:skin2(playerid,params[])
{
	ShowModelSelectionMenu(playerid, skinlist, "Select Skin");
	return 1;
}
Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
	if(listid == skinlist)
	{
	    if(response)
	    {
  			GameTextForPlayer(playerid,"~g~Skin Changed",2000,3);
        	SetPVarInt(playerid,"Useskin", 1);
        	GetPlayerSkin(playerid);
	    	SetPlayerSkin(playerid, modelid);
	    }
    	return 1;
	}
	return 1;
}
Do you think I missed something??
Reply
#2

pawn Код:
GameTextForPlayer(playerid,"~g~Skin Changed",2000,3);
pInfo[playerid][Skin] = modelid; // Assign the new skinid there.
SetPVarInt(playerid,"Useskin", 1);
GetPlayerSkin(playerid);
SetPlayerSkin(playerid, modelid);
Also:
pawn Код:
if(IsPlayerConnected(playerid))
{
    // code
}
else return ShowMessage(playerid, red, 2);
That's really useless.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
GameTextForPlayer(playerid,"~g~Skin Changed",2000,3);
pInfo[playerid][Skin] = modelid; // Assign the new skinid there.
SetPVarInt(playerid,"Useskin", 1);
GetPlayerSkin(playerid);
SetPlayerSkin(playerid, modelid);
Also:
pawn Код:
if(IsPlayerConnected(playerid))
{
    // code
}
else return ShowMessage(playerid, red, 2);
That's really useless.
haha lol. nice man it works like a charm. now there I can remove the /skin and change skin2 to skin. awesome! thanks for helping me again.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)