SetPVarInt & GetPVarInt
#1

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 "
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;
}
this is when its used; (all the way at the end)
[ 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 #
    }
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)
Reply


Messages In This Thread
SetPVarInt & GetPVarInt - by Tenshi - 26.02.2011, 05:37
Re: SetPVarInt & GetPVarInt - by deather - 26.02.2011, 06:21
Re: SetPVarInt & GetPVarInt - by Mean - 26.02.2011, 09:26
Re: SetPVarInt & GetPVarInt - by Tenshi - 28.02.2011, 00:48
Re: SetPVarInt & GetPVarInt - by nemesis- - 28.02.2011, 01:00
Re: SetPVarInt & GetPVarInt - by Tenshi - 28.02.2011, 01:27

Forum Jump:


Users browsing this thread: 1 Guest(s)