28.05.2009, 12:07
For people who might need it, i made this for DRPG
Top of your code:
End of your code:
To use this code (i.e. in an /refill command) use:
No else is required, because the messages come from the function!
Feel free to edit the coordinates, the ones used here are:
1. My custom gas station in Fort Carson
2. The unused gas station near the Clucking Bell in Fort Carson
3. The big gas station east of Las Venturas
Enjoy!
- Goz3rr
Top of your code:
Код:
forward IsAtGasStation(playerid);
Код:
public IsAtGasStation(playerid) { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2) { if(PlayerToPoint(5.0, playerid, -245.8878, 1207.6628, 19.7422) || PlayerToPoint(5.0, playerid, -245.8870, 1211.9666, 19.7422)) { return 1; } else if(PlayerToPoint(5.0, playerid, 623.7903, 1678.2412, 6.9922) || PlayerToPoint(5.0, playerid, 617.9302, 1687.8840, 6.9922) || PlayerToPoint(5.0, playerid, 611.1439, 1697.2592, 6.9922) || PlayerToPoint(5.0, playerid, 603.8867, 1706.3608, 6.9922)) { return 1; } else if(PlayerToPoint(7.0, playerid, 70.5051, 1219.3641, 18.8117)) { SendClientMessage(playerid, COLOR_RED, "Sorry, This Gas Station isn't in use!"); return 0; } SendClientMessage(playerid, COLOR_RED, "You must be at a Gas Station!"); return 0; } SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle and you must be the driver!"); return 0; }
Код:
if(IsAtGasStation(playerid)) { // Do here what should happen if the player is at a gas station }
Feel free to edit the coordinates, the ones used here are:
1. My custom gas station in Fort Carson
2. The unused gas station near the Clucking Bell in Fort Carson
3. The big gas station east of Las Venturas
Enjoy!
- Goz3rr