Need help: Randomization, Saving Jobs, Taxi System
#1

Hey there guys.

I've recieved a lot of help from you guys, and it's really nice.

The time has come again, I need some hints on how to script a few systems:

One: When a player chooses an option in a dialogue, a random Checkpoint or Pickup will be chosen (1 out of 30), and only that particular player can use and see it. When he reaches that pickup, there's a 1 minute timer that freezes the player meanwhile. When the timer is over, a new checkpoint will show on his map, randomly chosen again, 1/10. At this there is a 20 seconds timer, also freeze. When that's over, one last Checkpoint will show up, not random. When the player reaches this checkpoint, he will recieve 500$.

[Removed] Two:

[SOLVED]Three: Taxi System. The players of TEAM_TAXI (Team ID: 6) are taxi drivers, and when another player (any other team than id 6) enters as Passenger(not driver) and there is a Driver of team id 6 in the vehicle, the Passenger looses 5$ every second, and the driver gains them. The passenger can exit anytime he wants.



I'm not asking for final pieces of codes (even though that would be nice) - but just teach me how to do this? It really means a lot
Reply
#2

Don't mind the taxi thing - solved that one
Reply
#3

About part two, if get it right, you could use enums. And specific commands for each of the job. And if player disconnects, save hes information in the player file... (easily with Dini)
Reply
#4

I don't intend on using Login systems (at least not just yet)

I'll explain it a bit better I guess. The player chooses "Work at Office" in a dialog menu - a Checkpoint appears at 1 out of 30 possible desks(I have coords for them all), when the player touches the random Desk checkpoint, he freezes for 1min(Using TogglePlayerControl) and after the one minute, a checkpoint appears at 1 out of 10 filing cabinets(I have locations for those as well), when the player touches that Checkpoint, he freezes for 20 Seconds, after he's unfrozen a last Checkpoint appears at a Document Shelf(Location for that too) and when the player touches that last checkpoint he recieves 500$.

If someone explain how to work this out with timers and checkpoints, I'll be REALLY happy.

I'd like to point out that the Checkpoints should only be visible and usable for the player.
Reply
#5

I'ts easy.

First, make the dialog:

Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Available jobs","Office\nOthers","Ok","Cancel");
Now, after OnPlayerDialogResponse(blah,blah...), do this:

Код:
if(dialogid==1){
     if(response){
     if(listitem==0){
     new rand = random(ammount of coordinations u have in that array);
     SetPlayerCheckPoint(playerid,Coords[rand][0],Coords[rand][1],Coords[rand][2],5);
     }
     }
     }
You see, Coords[rand] name to the array you made with the coords. (it must be Float:Array) Like, my is Coords, and its Coords[rand]...

Do the rest of the on the callback OnPlayerEnterCheckPoint, you will have to use timers:

on the top of the script:
Код:
new Timer1;
and the timer, when you enter the checkpoint:
Код:
Timer1 = SetTimerEx("DoTheThing",TIME,false,"i",playerid);
DoTheThing - must be public callback made by you, for the rest things as you said...
Time - is the time in miliseconds...

Ok, so you should do rest of the thing, using this sample. Good luck !!!




Reply
#6

Ill try that. Thanks man!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)