command wont set in pinfo - 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: command wont set in pinfo (
/showthread.php?tid=467695)
command wont set in pinfo -
kbalor - 04.10.2013
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??
Re: command wont set in pinfo -
Konstantinos - 04.10.2013
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.
Re: command wont set in pinfo -
kbalor - 04.10.2013
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.