A small problem!!!
#1

Can someone tell me what's wrong here?No compiling errors,simply non-wrokage on game.

pawn Код:
new gBreakDown[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    gBreakDown[playerid] = 0;
    return 1;
}
public OnPlayerUpdate(playerid)
{
   new vehicleid = GetPlayerVehicleID(playerid);
   if(IsPlayerInAnyVehicle(playerid) && vehicleid == 437 && GetPlayerSpeed(playerid) > 60 && gBreakDown[playerid] == 0)
   {
     gBreakDown[playerid] = 1;
     SendClientMessage(playerid,COLOR_RED,"A bomb has been planted in your bus and if you slow down below 40 km/h,you'll be blwoed up");
   }
   if(IsPlayerInAnyVehicle(playerid) && vehicleid == 437 && gBreakDown[playerid] == 1 && GetPlayerSpeed(playerid) < 41)
   {
     gBreakDown[playerid] = 0;
     SendClientMessage(playerid,COLOR_RED,"You didn't obey the rule,BYE BYE!!!");
     SetVehicleHealth(vehicleid,0);
   }
    return 1;
}

stock GetPlayerSpeed(playerid, bool:kmh = true)
{
    new
        Float:xx,
        Float:yy,
        Float:zz,
        Float:pSpeed;

    if(IsPlayerInAnyVehicle(playerid))
    {
        GetVehicleVelocity(GetPlayerVehicleID(playerid),xx,yy,zz);
    }
    else
    {
        GetPlayerVelocity(playerid,xx,yy,zz);
    }

    pSpeed  = floatsqroot((xx * xx) + (yy * yy) + (zz * zz));
    return kmh ? floatround((pSpeed * 195.12)) : floatround((pSpeed * 121.9));
}
Reply


Messages In This Thread
A small problem!!! - by Cjgogo - 24.06.2011, 08:15
Re: A small problem!!! - by Cjgogo - 24.06.2011, 09:22
Re: A small problem!!! - by Babul - 24.06.2011, 10:32
Re: A small problem!!! - by Cjgogo - 24.06.2011, 12:47
Re: A small problem!!! - by Cjgogo - 24.06.2011, 13:45
Re: A small problem!!! - by Vince - 24.06.2011, 14:05

Forum Jump:


Users browsing this thread: 2 Guest(s)