26.02.2011, 05:37
Okay, I have a question. Well, more like a problem, and I'm not sure if its me.
I'm using SetPVarInt & GetPVarInt etc etc for skin saving while connected to server;
Wiki;
* https://sampwiki.blast.hk/wiki/SetPVarInt
* https://sampwiki.blast.hk/wiki/GetPVarInt - etc etc ...
" The command "
this is when its used; (all the way at the end)
[ edit ]
This is placed on: public OnPlayerSpawn(playerid)
now, when i placed this coding it seemed to work for a bit, now its not.
Is there another better way of doing this? ...
(I'm trying to avoid using timers to get GetPVarInt(playerid, "PlayerSkin") then set it- if you understand what i mean)
I'm using SetPVarInt & GetPVarInt etc etc for skin saving while connected to server;
Wiki;
* https://sampwiki.blast.hk/wiki/SetPVarInt
* https://sampwiki.blast.hk/wiki/GetPVarInt - etc etc ...
" The command "
pawn Код:
dcmd_vskin(playerid, params[])
{
new skin = strval(params);
if(IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid, "You can't use this command while in a vehicle.");
if(!strlen(params)) return SendSyntaxMessage(playerid, "/vskin [skin id]");
if(skin < MIN_SKIN_ID || skin > MAX_SKIN_ID || IsInvalidSkin(skin)) return SendErrorMessage(playerid, "Invalid skin ID.");
if(skin == 211 || skin == 217 || skin == 165 || skin == 147) return SendErrorMessage(playerid, "You can't use that skin. Choose another one.");
SetPlayerSkin(playerid, skin);
SetPVarInt(playerid, "PlayerSkin", skin); // #This is where the Var is placed#
return 1;
}
[ edit ]
This is placed on: public OnPlayerSpawn(playerid)
pawn Код:
// Set player skin to users (staff or player)
if(GetPVarInt(playerid, "PlayerSkin"))
{
SetPlayerSkin(playerid, GetPVarInt(playerid, "PlayerSkin")); // # Universal #
}
Is there another better way of doing this? ...
(I'm trying to avoid using timers to get GetPVarInt(playerid, "PlayerSkin") then set it- if you understand what i mean)