check if is player connected
#1

PHP код:
public BusinessTimer()
{
    foreach(new 
Business)
    {
        if((
gettime() - BusinessData[i][LastVisited]) > BUSINESS_DAYS 86400)
        {
            
Business_Reset(i);
            continue;
        }
        if(!
BusinessData[i][Closed] && BusinessData[i][SalePrice] == && strcmp(BusinessData[i][Owner], "-"))
        {
            
BusinessData[i][Money] += BusinessData[i][Earning];
            
BusinessData[i][Save] = true;
        }
        if(
BusinessData[i][Save]) Business_Save(i);
    }
    return 
1;

so i want to check if the owner of the business is connected on the server,if they not connected it should return to 0;
Reply
#2

Use the IsPlayerConnected function.
Reply
#3

Not sure if this is what you meant, like @SickAttack said above, but if it is.
Read this > https://sampwiki.blast.hk/wiki/IsPlayerConnected
Reply
#4

ok thanks,but why is this code doesnt work?

PHP код:
            new str2[228];
            new 
Float:armour;
            new 
Float:health;
            
GetPlayerArmour(playeridarmour);
            
GetPlayerHealth(playeridhealth);
            
format(str2,sizeof(str2),"~n~~n~~n~~n~~n~~n~~b~~h~~h~%s~n~~w~ARMOUR:%0.2f ~r~Health:%0.2f "pName[damagedid], armourhealth);
            
GameTextForPlayer(playeridstr210003); 
it only shows the playername
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)