10.03.2016, 08:55
This should get you started.
Try searching for these the next time.
Try searching for these the next time.
PHP код:
#define MAX_GAS_PUMPS 5
enum gaspumpData {
Float:xPos,
Float:yPos,
Float:zPos
}
new GasPumpLoc[MAX_GAS_PUMPS][gaspumpData] = {
/*
Edit below with the coords of your gas pumps
*/
{X, Y, Z},
{X, Y, Z},
{X, Y, Z},
{X, Y, Z},
{X, Y, Z}
};
CMD:repair(playerid, params[])
{
if(!IsPlayerNearAGasPump(playerid))
return SendClientMessage(playerid, -1, "No where near a place you can repair your vehicle.");
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, -1, "You must be inside a vehicle to use this command.");
// Repair, or whatever you have to do..
return 1;
}
IsPlayerNearAGasPump(playerid)
{
for(new i = 0; i < sizeof(GasPumpLoc); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, GasPumpLoc[i][xPos], GasPumpLoc[i][yPos], GasPumpLoc[i][zPos])) return 1;
}
return 0;
}