30.11.2015, 13:13
Create a checkpoint?
Put this ongamemodeinit or onfilterscriptinit.
NOTE this will send the message every time the player enters the checkpoint, so if he walks trough it 5 times he'll gain the reward 5 times, there is no cooldown, if you would like a cooldown, i suggest adding a timer.
Put this ongamemodeinit or onfilterscriptinit.
Код:
CPNAME = CreateDynamicCP(X, Y, Z, 1.3, -1, 0, -1, 65.0); //create a checkpoint named CPNAME at X Y Z Create3DTextLabel("[The Finish!]", COLOR_YELLOW, X, Y, Z + 0.2, 7.5, 0, 1); //Place a message above the checkpoint.
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid) { if(checkpointid == CPNAME) //we named the checkpoint CPNAME so its identified here. { SendClientMessage(playerid, COLOR_WHITE, "* You completed the challenge!"); // Sending a message. SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); // get the players score and add +1 SendClientMessage(playerid, COLOR_WHITE, "* You gained +1 Score"); // Sending a message. GivePlayerMoney(playerid, 1000); // Give the player 1000 Money ontop of his current balance. SendClientMessage(playerid, COLOR_WHITE, "* You gained $1000 aswell!"); // Sending a message. } Return 1; }
NOTE this will send the message every time the player enters the checkpoint, so if he walks trough it 5 times he'll gain the reward 5 times, there is no cooldown, if you would like a cooldown, i suggest adding a timer.