Pvar problem
#1

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

We cannot help you without the code.
Reply
#3

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"
Reply
#4

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!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)