PVar/GVar isn't loading. - 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: PVar/GVar isn't loading. (
/showthread.php?tid=586706)
PVar/GVar isn't loading. -
SpikY_ - 24.08.2015
Hi, I have Set Pvar in my gamemode and i've Set GetPVarInt in my Filterscript, but the problem is its not loading in my filterscript.
look:
Код:
AccInfo[playerid][MissionPass]++;
SetPVarInt(playerid, "MissionPass", AccInfo[playerid][MissionPass]); //PVar is here
new str[128]; format(str, 128, "PVar/MissionPass: %d", GetPVarInt(playerid, "MissionPass"));
SendClientMessage(playerid, -1, str);
When the gamemode's timer ended, it says " PVar/MissionPass: 1 " and filterscript also shows "1" but when the gamemode changes, it come back on "0". There were some guys who told me to follow the same format in my next gamemode but still not solved. that thread was old and i thought of creating new.
https://sampforum.blast.hk/showthread.php?tid=582684 - OLD THREAD.
Re: PVar/GVar isn't loading. -
SpikY_ - 24.08.2015
Anyone? please
Re: PVar/GVar isn't loading. -
Gammix - 24.08.2015
Player Variables automatically destroy when the player disconnects. So i guess when your gamemode exits, OnPlayerDisconnect is called which destroys the PVars.
Re: PVar/GVar isn't loading. -
SpikY_ - 25.08.2015
But i have set another player Variables in my next gamemode, then why its getting deleted.
Any Solution.!?
Re: PVar/GVar isn't loading. -
YoussefHammad - 25.08.2015
Try to put it like this
EDIT:
Код:
SetPVarInt(playerid, "MissionPass", GetPVarInt(playerid,"MissionPass")+1); //PVar is here
AccInfo[playerid][MissionPass]++;
instead of
Код:
AccInfo[playerid][MissionPass]++;
SetPVarInt(playerid, "MissionPass", AccInfo[playerid][MissionPass]); //PVar is here
not sure if it will work but i had the same problem before , it worked when i did this
EDIT: add this to ur OnDialogResponse (when player logs in and his stats are loading)
Код:
SetPVarInt(playerid,"MissionPass",AccInfo[playerid][MissionPass]);
tell me if it doesnt work
Re: PVar/GVar isn't loading. -
SpikY_ - 26.08.2015
still same!