SA-MP Forums Archive
Help! playerid not being called in local functions? - 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: Help! playerid not being called in local functions? (/showthread.php?tid=576708)



Help! playerid not being called in local functions? - Airman123 - 06.06.2015

Hello,

Today, i just found something that amazed me.

we all know there are samp local functions such as:-
OnPlayerSpawn(playerid);
OnPlayerConnect(playerid);
OnPlayerDisconnect(playerid);


You see? playerid is defined? but it doesn't works as it should.

my problem is, i've made houses in ma server. there is a thing "OwnerID" in it.
Im using dini saving system.

So under onplayerspawn i used

if players has a owned house, hInfo[houseid][ownerid] = playerid;
and savehousestats(houseid);


but it doesn't works and in the house .ini file its still -1 (no id)..

so im having problems in breaking system (owner online/offline)

i need some one help? how can i fix it.

ownerid is replaced perfectly when a owner visits house (i used same code)

and when an unowned house is bought by a player, his id is written in OWNERID!


// onplayerspawn code

PHP код:
    if(pInfo[playerid][OwnedHouses] == 1)
    {
            new 
Houseid h_ID[playerid];
            
hInfo[Houseid][h_OwnerID] = playerid;
            
SaveHouse(Houseid);
            
LoadHouse(Houseid);
    } 
sorry for bad english, but i think i explained my problem well? so anyone can help me out??


Re: Help! playerid not being called in local functions? - [KHK]Khalid - 06.06.2015

Quote:

and when an unowned house is bought by a player, his id is written in OWNERID!

Show code of that (buying a house) and code of SaveHouse as well.


Re: Help! playerid not being called in local functions? - Vince - 06.06.2015

Ew, dini. Please use something better.

Callbacks not being called when they should is usually caused by improper hooking in includes. Do you use any includes which hook callbacks?


Re: Help! playerid not being called in local functions? - Airman123 - 26.06.2015

fixed