PVar/GVar isn't loading.
#1

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.
Reply
#2

Anyone? please
Reply
#3

Player Variables automatically destroy when the player disconnects. So i guess when your gamemode exits, OnPlayerDisconnect is called which destroys the PVars.
Reply
#4

But i have set another player Variables in my next gamemode, then why its getting deleted.
Any Solution.!?
Reply
#5

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
Reply
#6

still same!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)