#include #define CAR_PHONE_RING 20600 // drive by #define CHECKPOINT_driveby 1 //drive by #define CHECKPOINT_driveby2 2 // drive by new gPlayerCheckpointStatus[MAX_PLAYERS]; //drive by main() { print("\n----------------------------------"); print(" This is a blank GameModeScript"); print("----------------------------------\n"); } //////////////////////////////////////////////////// /////////////////////////////////////////////////// public IsPlayerInCube(playerid, xmin, ymin, zmin, xmax, ymax, zmax) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if( x > xmin && y > ymin && z > zmin && x < xmax && y < ymax && z < zmax) return 1; return 0; } public OnPlayerEnterCheckpoint(playerid) { switch (gPlayerCheckpointStatus[playerid]) { case CHECKPOINT_driveby: { PlayerPlaySound(playerid, 20600, 2377.4026,-1908.9188,12.9885); SetTimer("kill",2000,1); } case CHECKPOINT_driveby2: { KillTimer(1); } } return 1; } public kill(playerid) { SetPlayerHealth(playerid, 0.0); } public driveby(playerid) { for (new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { if(IsPlayerInCube(playerid,2343,1663,0,2508,1933,20)) { gPlayerCheckpointStatus[i] = CHECKPOINT_driveby; SetPlayerCheckpoint(i,2377.4026,-1908.9188,12.9885,5); } else { DisablePlayerCheckpoint(i); } } } } public driveby2(playerid) { for (new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { if(IsPlayerInCube(playerid,2343,1663,0,2508,1933,20)) { gPlayerCheckpointStatus[i] = CHECKPOINT_driveby2; SetPlayerCheckpoint(i,2487.2593,-1666.7709,13.0814,5); } else { DisablePlayerCheckpoint(i); } } } } //////////////////////////////////////////////////// /////////////////////////////////////////////////// public OnGameModeInit() { print("GameModeInit()"); SetTimer("driveby", 100,1); SetTimer("driveby2", 100,1); SetTimer("kill", 20000,1); // drive by SetGameModeText("Blank Script"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; }