07.08.2010, 01:10
(
Last edited by Crusher!!; 07/08/2010 at 03:48 AM.
)
Script
-------------------------
Scripting-------------------------
- Information
- Callbacks
- Functions
______________________________________
Information
The generator generates a file Race.Crshr, if you change anything in that file. Information
maybe your checkpoints/vehicles/objects won't work anymore!
To edit the checkpoints, use the Generated_Pawn.pwn file.
You can only have one Race.Crshr in a directory.
______________________________________
Callbacks
Because i used some callbacks i has to make new one.. and here they are.Callbacks
Code:
public Crshr_Init() { return 1; }
Code:
public Crshr_Exit() { return 1; }
Code:
public OnPlayerRaceStart(playerid) { return 1; }
Code:
GameTextForPlayer(playerid,"~w~Youre race is started!",3000,5);
Code:
public OnPlayerFinish(playerid,CheckPoint) { return 1; }
Code:
switch(CheckPoint) { case 1: { SendClientMessage(playerid,COLOR_BLUE,"You reached checkpoint 1!"); } case 2: { SendClientMessage(playerid,COLOR_BLUE,"You reached checkpoint 1!"); } } // Or... if(CheckPoint == 8) { SendClientMessage(playerid,COLOR_BLUE,"Congrets!. You finished the race"); }
Code:
public OnPlayerRaceStop(playerid) { return 1; }
______________________________________
Functions
Functions
Code:
StartRaceForAll()
Code:
StartRaceForPlayer(playerid)
- playerid - a ID of a online player
Code:
StopRaceForAll()
Code:
StopRaceForPlayer(playerid)
- playerid - a ID of a online player
Code:
ShowCheckPointCount(bool:Show)
- Show - On = true, Off = false
Code:
IsPlayerRacing(playerid)
- playerid - a ID of a online player
Code:
//maybe for a teleport if(!IsPlayerRacing(playerid)) SetPlayerPos(1234.0,1234.0,10.0);
Code:
IsRaceGoing()
Code:
// A message? if(IsRaceGoing()) SendClientMessageToAll(COLOR_BLUE,"Go Racers Go!");
Code:
SetSpecificCar(model)
- model - Vehicle Model, can be turned off with 0
Code:
SetCheckPointSize(size)
- size - The size you want your checkpoints. starting at 0
Code:
SetCheckPointSize(size)
- size - The size you want your finish checkpoint . starting at 0
______________________________________