Help! playerid not being called in local functions?
#1

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

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

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

fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)