08.11.2016, 04:19
Basically you need this function created by Y_Less.
Then you call the function since you want it in OnPlayerEnterCheckpoint do it there.
This hasn't been tested. Also it's best that if you're going to be using multiple checkpoints to use a streamer and use CreateDynamicCP because defaulty using SetPlayerCheckpoint you can only have 1 in your server. This may cause issues and it's also a good idea to give each checkpoint an ID so that if you have several different checkpoints doing different things that each checkpoint is doing what they are meant to be doing. I hope this helps you.
Also just letting you know that if you are going to continue to request scripts you should be doing it on this topic. https://sampforum.blast.hk/showthread.php?tid=447813
Because requesting scripting and not giving it a go is not supposed to be posted in this section.
Code:
randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum; // Credits to Y_Less (Add this anywhere in your script)
PHP Code:
public OnPlayerEnterCheckpoint(playerid)
{
new rand, string[128];
rand = randomEx(5000, 6500); //Creates a random number between 5000, and 6500
GivePlayerMoney(playerid, rand); //Gives the player the random number generated
format(string,sizeof(string), "You have been given $%d.", rand); //Formats the message that will be displayed to the player
SendClientMessage(playerid, COLOR_WHITE, string); //Prints the message
return 1;
}
Also just letting you know that if you are going to continue to request scripts you should be doing it on this topic. https://sampforum.blast.hk/showthread.php?tid=447813
Because requesting scripting and not giving it a go is not supposed to be posted in this section.