Modificated 17-11-12
This commands is for Warchief
[pawn] /*Comando para reparar vehiculo en Pay N spray */
else if(strcmp(cmdtext, "reparar", true) == 0) {
if(PlayerToPoint(6, playerid,-870.66674, -118.24742, 10.65336 ) || PlayerToPoint(6, playerid,-912.51165, -1268.10986, 11.86920) || PlayerToPoint(6, playerid,-11.25934, -1258.25854, 10.23682) || PlayerToPoint(6, playerid,327.91986, 430.80700, 11.16345)) {
new cash = GetPlayerMoney(playerid);
if(cash >= 500) {
SendClientMessage(playerid,COLOR_YELLOW,"Has reparado tu vehiculo");
SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
DecPlayerCash(playerid,500);
}
if(cash < 499) {
SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $500 para reparar el vehiculo!");
}
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Solo se repara en Pay N Spray");
}
return 1;
} [/pawn]
This commands is for another script
[pawn] else if(strcmp(cmdtext, "reparar", true) == 0) {
if(PlayerToPoint(6, playerid,-870.66674, -118.24742, 10.65336 ) || PlayerToPoint(6, playerid,-912.51165, -1268.10986, 11.86920) || PlayerToPoint(6, playerid,-11.25934, -1258.25854, 10.23682) || PlayerToPoint(6, playerid,327.91986, 430.80700, 11.16345)) {
new cash = GetPlayerMoney(playerid);
if(cash >= 500) {
SendClientMessage(playerid,COLOR_YELLOW,"Has reparado tu vehiculo");
SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
DecPlayerHandCash(playerid,500);
}
if(cash < 499) {
SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $500 para reparar el vehiculo!");
}
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Solo se repara en Pay N Spray");
}
return 1;
} [/pawn]
this is the public
[pawn] //==============================================================================
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
//============================================================================== [/pawn]