SA-MP Forums Archive
Pvar problem - 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: Pvar problem (/showthread.php?tid=257594)



Pvar problem - clavador - 26.05.2011

Hi.

Im setting a Pvar inside a filterscript like this:

SetPVarInt(playerid, "logged", 1);

Then I'm trying to retrieve it from the gamemode:

if(GetPVarInt(playerid, "logged") == 1)

Well, that's not working...

But is curious because i copy the exact same code and paste it inside the gamemode and it works.

Any suggestions?


Re: Pvar problem - Markx - 26.05.2011

We cannot help you without the code.


Re: Pvar problem - clavador - 26.05.2011

There's no much code,is just that...

In the gamemode:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(GetPVarInt(playerid, "logged") == 1) return SendClientMessage(playerid, 0xFFFF00, "TEST OK.");

return 1;
}

In the filterscipt:

public OnPlayerSpawn(playerid)
{
//---------------------------ANTI CHEAT-----------------------------------------
Timer4[playerid] = SetTimer("Jetpack",1000,1);
Timer[playerid] = SetTimerEx("CheckPing",3000,1,"i",playerid);
Timer2[playerid] = SetTimerEx("CheckMG",1000,1,"i",playerid);
SetPVarInt(playerid, "logged", 1);
return 1;
}

Is just a test. When you spawn the filterscript sets the pvar to one and when you try any command the gamemode will respond "TEST OK"


Re: Pvar problem - clavador - 26.05.2011

It's weird... I think it was the server. It work after i shut it and restart. It's weird because the first time i tried that but it didn't work. It was driving me mad!!