Help Me in Kidnap Script :)
#1

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;

Reply
#2

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)