forward CarSpawner(playerid,model);
public CarSpawner(playerid,model)
{
if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, 0x33AA33AA, "You already have a car!");
else
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
//if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);
new vehicleid=CreateVehicle(model, x, y, z, angle, -1, -1, -1);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, vehicleid, 0);
ChangeVehicleColor(vehicleid,0,7);
//PlayerInfo[playerid][pCar] = vehicleid;
}
return 1;
}
CarSpawner(playerid,model)
{
if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, 0x33AA33AA, "You already have a car!");
else
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
//if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);
new vehicleid=CreateVehicle(model, x, y, z, angle, -1, -1, -1);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, vehicleid, 0);
ChangeVehicleColor(vehicleid,0,7);
//PlayerInfo[playerid][pCar] = vehicleid;
}
return 1;
}
PHP Code:
PHP Code:
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 |
//speedo1 new Text:Textdraw0; new Text:Textdraw1; new Text:Textdraw2; new PlayerText:Textdraw3[MAX_PLAYERS]; new Text:Textdraw4; new Text:Textdraw5; new PlayerText:Textdraw6[MAX_PLAYERS]; new PlayerText:Textdraw7[MAX_PLAYERS]; new PlayerText:Textdraw8[MAX_PLAYERS]; new PlayerText:Textdraw9[MAX_PLAYERS]; new PlayerText:Textdraw10[MAX_PLAYERS]; new PlayerText:Textdraw11[MAX_PLAYERS]; new PlayerText:Textdraw12[MAX_PLAYERS]; //speedo2 new Text:speedom0; new Text:speedom1; new Text:speedom2; new PlayerText:speedom3[MAX_PLAYERS]; new PlayerText:speedom4[MAX_PLAYERS]; new PlayerText:speedom5[MAX_PLAYERS]; new PlayerText:speedom6[MAX_PLAYERS]; new PlayerText:speedom7[MAX_PLAYERS]; new PlayerText:speedom8[MAX_PLAYERS]; new PlayerText:speedom9[MAX_PLAYERS]; new PlayerText:speedom10[MAX_PLAYERS]; new PlayerText:speedom11[MAX_PLAYERS]; new PlayerText:speedom12[MAX_PLAYERS]; new PlayerText:speedom13[MAX_PLAYERS]; new PlayerText:speedom14[MAX_PLAYERS]; new PlayerText:speedom15[MAX_PLAYERS]; new PlayerText:speedom16[MAX_PLAYERS]; new Text:speedom17; new Text:speedom18; new Text:speedom19; new PlayerText:speedom20[MAX_PLAYERS]; new PlayerText:speedom21[MAX_PLAYERS]; new PlayerText:speedom22[MAX_PLAYERS]; new Text:speedom23; //speed02 new Text:speedm0; new Text:speedm1; new PlayerText:speedm2[MAX_PLAYERS]; new Text:speedm3; new PlayerText:speedm4[MAX_PLAYERS]; new PlayerText:speedm5[MAX_PLAYERS]; new Text:speedm6; new PlayerText:speedm7[MAX_PLAYERS]; new PlayerText:speedm8[MAX_PLAYERS]; new PlayerText:speedm9[MAX_PLAYERS]; new PlayerText:speedm10[MAX_PLAYERS];
Code:
//speedo1 new Text:Textdraw0; new Text:Textdraw1; new Text:Textdraw2; new PlayerText:Textdraw3[MAX_PLAYERS]; new Text:Textdraw4; new Text:Textdraw5; new PlayerText:Textdraw6[MAX_PLAYERS]; new PlayerText:Textdraw7[MAX_PLAYERS]; new PlayerText:Textdraw8[MAX_PLAYERS]; new PlayerText:Textdraw9[MAX_PLAYERS]; new PlayerText:Textdraw10[MAX_PLAYERS]; new PlayerText:Textdraw11[MAX_PLAYERS]; new PlayerText:Textdraw12[MAX_PLAYERS]; //speedo2 new Text:speedom0; new Text:speedom1; new Text:speedom2; new PlayerText:speedom3[MAX_PLAYERS]; new PlayerText:speedom4[MAX_PLAYERS]; new PlayerText:speedom5[MAX_PLAYERS]; new PlayerText:speedom6[MAX_PLAYERS]; new PlayerText:speedom7[MAX_PLAYERS]; new PlayerText:speedom8[MAX_PLAYERS]; new PlayerText:speedom9[MAX_PLAYERS]; new PlayerText:speedom10[MAX_PLAYERS]; new PlayerText:speedom11[MAX_PLAYERS]; new PlayerText:speedom12[MAX_PLAYERS]; new PlayerText:speedom13[MAX_PLAYERS]; new PlayerText:speedom14[MAX_PLAYERS]; new PlayerText:speedom15[MAX_PLAYERS]; new PlayerText:speedom16[MAX_PLAYERS]; new Text:speedom17; new Text:speedom18; new Text:speedom19; new PlayerText:speedom20[MAX_PLAYERS]; new PlayerText:speedom21[MAX_PLAYERS]; new PlayerText:speedom22[MAX_PLAYERS]; new Text:speedom23; //speed02 new Text:speedm0; new Text:speedm1; new PlayerText:speedm2[MAX_PLAYERS]; new Text:speedm3; new PlayerText:speedm4[MAX_PLAYERS]; new PlayerText:speedm5[MAX_PLAYERS]; new Text:speedm6; new PlayerText:speedm7[MAX_PLAYERS]; new PlayerText:speedm8[MAX_PLAYERS]; new PlayerText:speedm9[MAX_PLAYERS]; new PlayerText:speedm10[MAX_PLAYERS]; all textdraws are global. worst indentation. lots of public functions - useless. repeated code at lots of places. untidy code and bad looking textdraws. fix them all. |
- see from open eyes not all textdraws are global.
- i have tested it and it doesnot drop fps. - no repeated codes - no untidy codes found you are the one who is a jelous peep nigga. |
GetVehicleHP(vehicleid)
{
new veh_hp_result, Float:veh_hp;
GetVehicleHealth(vehicleid, veh_hp);
veh_hp_result = floatround((floatsub(veh_hp, 250))/7.5);
if(veh_hp_result > 0) return veh_hp_result;
return 0;
}
- see from open eyes not all textdraws are global.
- i have tested it and it doesnot drop fps. - no repeated codes - no untidy codes found you are the one who is a jelous peep nigga. |