04.10.2011, 19:44
Hello!
im trying to get this cmd to work, but it doesnt...
its a reinforcement cmd that gives you more vehicle health if you have enough with money.
But i cant figure out why this isn't working, hope someone can help me out.
Code:
im trying to get this cmd to work, but it doesnt...
its a reinforcement cmd that gives you more vehicle health if you have enough with money.
But i cant figure out why this isn't working, hope someone can help me out.
Code:
pawn Код:
CMD:reinforcement(playerid, params[])
{
if(GetPlayerMoney(playerid) > 0 && GetPlayerMoney(playerid) < 4999) return SendClientMessage(playerid, 0xFFFFFFFF, "You dont have enough money!");
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInRangeOfPoint(playerid, 20.0, 405.8782,2460.9792,17.2118))
{
if(GetVehicleModel(vehicleid) == 432) SetVehicleHealth(vehicleid, 3000.0);
if(GetVehicleModel(vehicleid) == 553) SetVehicleHealth(vehicleid, 3000.0);
if(GetVehicleModel(vehicleid) == 476) SetVehicleHealth(vehicleid, 2000.0);
if(GetPlayerTeam(playerid) == 0) SendClientMessage(playerid,0xFFFFFFFF,"You have reinforced your vehicle!");
GivePlayerMoney(playerid, -5000);
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
if(IsPlayerInRangeOfPoint(playerid, 20.0, 1619.4607,1337.4252,10.8095))
{
if(GetVehicleModel(vehicleid) == 432) SetVehicleHealth(vehicleid, 3000.0);
if(GetVehicleModel(vehicleid) == 553) SetVehicleHealth(vehicleid, 3000.0);
if(GetVehicleModel(vehicleid) == 476) SetVehicleHealth(vehicleid, 2000.0);
GivePlayerMoney(playerid, -5000);
if(GetPlayerTeam(playerid) == 1) SendClientMessage(playerid,0xFFFFFFFF,"You have reinforced your vehicle!");
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
if(IsPlayerInRangeOfPoint(playerid, 20.0, 1874.7584,-2288.3972,14.2586))
{
if(GetVehicleModel(vehicleid) == 432) SetVehicleHealth(vehicleid, 3000.0);
if(GetVehicleModel(vehicleid) == 553) SetVehicleHealth(vehicleid, 3000.0);
if(GetVehicleModel(vehicleid) == 476) SetVehicleHealth(vehicleid, 2000.0);
GivePlayerMoney(playerid, -5000);
if(GetPlayerTeam(playerid) == 2) SendClientMessage(playerid,0xFFFFFFFF,"You have reinforced your vehicle!");
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
if(IsPlayerInRangeOfPoint(playerid, 20.0, -1372.7068,-214.9956,14.1484))
{
if(GetVehicleModel(vehicleid) == 432) SetVehicleHealth(vehicleid, 3000.0);
if(GetVehicleModel(vehicleid) == 553) SetVehicleHealth(vehicleid, 3000.0);
if(GetVehicleModel(vehicleid) == 476) SetVehicleHealth(vehicleid, 2000.0);
GivePlayerMoney(playerid, -5000);
if(GetPlayerTeam(playerid) == 3) SendClientMessage(playerid,0xFFFFFFFF,"You have reinforced your vehicle!");
}
else SendClientMessage(playerid,0xFFFFFFFF,"You are not at your repair area or in a tank - andromada - rustler!");
return 1;
}