SetPVarInt - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPVarInt (
/showthread.php?tid=269850)
SetPVarInt -
GloomY - 18.07.2011
I'm having some problems with SetPVarInt on my gamemode.
This is the code:
pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 4)
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPbiskey] == biz)
{
PlayerInfo[i][pPbiskey] = 255;
}
else
{
format(string, sizeof(string),"accounts/%s.ini",BizzInfo[biz][bOwner]);
SetPVarInt(BizzInfo[biz][bOwner], "Bizz", 255);
}
}
}
if(PlayerInfo[i][pPbiskey] == biz) works fine when the owner of the biz is online on the server, but I have problems to set up on his .ini file when the owner of the biz is offline. It doesn't set up the "Bizz" line on 255.
Is this possible with pVar, if it is - what do I have to do?
Re: SetPVarInt -
JaTochNietDan - 18.07.2011
PVars are only for currently connected players, which is why you have to specify a player ID in the function.
Also I don't really understand your code, are you trying to use SetPVarInt as a file writing function?
Re: SetPVarInt -
GloomY - 18.07.2011
I want it to edit the "Bizz" line in .ini file of the registered player while that player is offline. So it goes from "Bizz = 0" to "Bizz = 255".
Re: SetPVarInt -
JaTochNietDan - 18.07.2011
Quote:
Originally Posted by Haxby
I want it to edit the "Bizz" line in .ini file of the registered player while that player is offline. So it goes from "Bizz = 0" to "Bizz = 255".
|
You should be using some sort of ini parsing API then, not SetPVarInt, that has nothing to do with ini files!
You should take a look at the Y_ini or dini libraries.
Re: SetPVarInt -
GloomY - 18.07.2011
Ok, I thought there is a way with pVar...
Thanks.