3 Errors
#3

Quote:
Originally Posted by Sinner
Посмотреть сообщение
PHP код:
public OnPlayerUpdate(playerid)
{
    new 
Float:H;
    
GetPlayerHealth(playerid,H);
    if(
H<99)
    {
        
SetPlayerHealth(playerid,100);
        return 
1;
    }
       if(
IsPlayerConnected(playerid))
       {
        
GetVehicleHealth(GetPlayerVehicleID(playerid), H);
        if(
1000)
        {
            
SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
        }
    }
    return 
1;

Here's correct code.

I should notice though, this is some very bad scripting for the following reasons:

1. You use OnPlayerUpdate to fix cars and heal players, and at 99% health? Use a timer instead, since OPU checks every 20ms which is way too fast for anything.
2. You do a loop through all players in OPU? Why? Its already checking for all players seperate.

You should read up on pawno a little more, this snippet was awfully inefficient, it would work but your server would lagg if you ever got a little more people on.
Yes I am sorry,this is a script I made a year ago and I did not use it untill now /=
Thank you very very much anyway
Reply


Messages In This Thread
3 Errors - by nuriel8833 - 22.04.2011, 14:58
Re: 3 Errors - by Sinner - 22.04.2011, 15:09
Re: 3 Errors - by nuriel8833 - 22.04.2011, 15:12
Re: 3 Errors - by Sinner - 22.04.2011, 15:15
Re: 3 Errors - by nuriel8833 - 22.04.2011, 15:26
Re: 3 Errors - by Sinner - 22.04.2011, 15:49

Forum Jump:


Users browsing this thread: 1 Guest(s)