24.01.2014, 20:06
Look at the wiki pages. It clearly shows how to create checkpoints.
This code is not tested and may contain bugs, since I wrote it right here on the forums.
Код:
new Text:upgrade_text_draw; new bool:can_upgrade[MAX_PLAYERS]; public OnGameModeInit() { upgrade_text_draw = TextDrawCreate(240.0,580.0,"Press space to repair your vehicle."); return 1; } public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); return 1; } public OnPlayerEnterCheckpoint(playerid) { TextDrawShowForPlayer(playerid, upgrade_text_draw); can_upgrade[playerid] = true; return 1; } public OnPlayerLeaveCheckpoint(playerid) { TextDrawHideForPlayer(playerid, upgrade_text_draw); can_upgrade[playerid] = false; return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_JUMP)) { if(can_upgrade[playerid] == true) { SetPlayerVehicleHealth(GetPlayerVehicleID(playerid), 1000.0); } } return 1; }