SA-MP Forums Archive
Help Me in Kidnap Script :) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Me in Kidnap Script :) (/showthread.php?tid=571962)



Help Me in Kidnap Script :) - astanalol - 24.04.2015

Hello Every One
Guys i Want know somthings
how i can make Random CP For Kidnap And After He is in CP Take Random Money ? This Smail Help
+Reps
PHP код:
CMD:kidnap(playeridparams[])
{
    new 
id;
    if(
sscanf(params,"d",id)) return SendClientMessage(playerid0xFF0000FF"USAGE: /kidnap [id]");
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid0xFF0000FF"ERROR: You must be on vehicle!");
    if(
noexit[id] == 1noexit[id] = 0;
    
noexit[id] = 1;
    
PutPlayerInVehicle(idGetPlayerVehicleID(playerid), 1);
    return 
1;




Re: Help Me in Kidnap Script :) - TakeiT - 24.04.2015

You need to use the function random. Go to the places that you want the checkpoint to possibly be and type /save to get the data then put it into an array. From there, you can use a random to get one id in the array and set the checkpoint to that. You can also use random to get the amount of cash.

https://sampwiki.blast.hk/wiki/Random

They use random spawns as an example here, but it's pretty much the same thing