[FilterScript] Advance Double Speed-O-Meter [Version 2]
#5

Quote:
Originally Posted by Lokii
View Post
PHP Code:
forward CarSpawner(playerid,model);
public 
CarSpawner(playerid,model)
{
    if(
IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid0x33AA33AA"You already have a car!");
    else
    {
        new 
Float:xFloat:yFloat:zFloat:angle;
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playeridangle);
        
//if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);
        
new vehicleid=CreateVehicle(modelxyzangle, -1, -1, -1);
        
SetVehicleVirtualWorld(vehicleidGetPlayerVirtualWorld(playerid));
        
LinkVehicleToInterior(vehicleidGetPlayerInterior(playerid));
        
PutPlayerInVehicle(playeridvehicleid0);
        
ChangeVehicleColor(vehicleid,0,7);
        
//PlayerInfo[playerid][pCar] = vehicleid;
    
}
    return 
1;

why not

PHP Code:
CarSpawner(playerid,model)
{
    if(
IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid0x33AA33AA"You already have a car!");
    else
    {
        new 
Float:xFloat:yFloat:zFloat:angle;
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playeridangle);
        
//if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);
        
new vehicleid=CreateVehicle(modelxyzangle, -1, -1, -1);
        
SetVehicleVirtualWorld(vehicleidGetPlayerVirtualWorld(playerid));
        
LinkVehicleToInterior(vehicleidGetPlayerInterior(playerid));
        
PutPlayerInVehicle(playeridvehicleid0);
        
ChangeVehicleColor(vehicleid,0,7);
        
//PlayerInfo[playerid][pCar] = vehicleid;
    
}
    return 
1;

AND

why use 3 callbacks 1 to get health 2 to set speedtextdraw and 3 get speed while this could be done in 1 callback

You could use 1 timer

Why include foreach and not use it?

Why dont you destroy player text draw when player leaves
that code i used to spawn car in server forgot to remove and all other things are perfectly fine!
Reply


Messages In This Thread
Advance Double Speed-O-Meter [Version 2] - by PgMNA - 16.07.2018, 10:17
Re: Advance Double Speed-O-Meter [Version 2] - by Lokii - 16.07.2018, 17:32
Re: Advance Double Speed-O-Meter [Version 2] - by Freaksken - 16.07.2018, 17:41
Re: Advance Double Speed-O-Meter [Version 2] - by Usmanmemon - 16.07.2018, 22:00
Re: Advance Double Speed-O-Meter [Version 2] - by PgMNA - 16.07.2018, 22:45
Re: Advance Double Speed-O-Meter [Version 2] - by xMoBi - 17.07.2018, 08:55
Re: Advance Double Speed-O-Meter [Version 2] - by PgMNA - 17.07.2018, 09:10
Re: Advance Double Speed-O-Meter [Version 2] - by Lokii - 17.07.2018, 09:46
Re: Advance Double Speed-O-Meter [Version 2] - by CodeStyle175 - 17.07.2018, 10:38
Re: Advance Double Speed-O-Meter [Version 2] - by xMoBi - 17.07.2018, 13:09

Forum Jump:


Users browsing this thread: 1 Guest(s)