[UNSOLVED] Checkpoints, checkpoints, checkpoints :P -
Fredden1993 - 18.12.2010
Howdy,
I'm trying to script a good license system for vehicles and I'm about 50% done with it, now I just need the part when you enter a license vehicle, in the case ID: 405 and type /licenseexam.
What I want this command to do is create a checkpoint and when the player drive through the checkpoint it will create another one, it will do like this around five times around LS then it will create the last checkpoint back at the DMV.
When they reach the last checkpoint the will get $5000 removed and they will gain the license (Which I will script later).
Basicly, I need help to create something that creates new checkpoints when entering one.
Thanks
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
akis_tze - 18.12.2010
Take a variable for the player
Example: Make something like that
when the player type /licenseexam
make his variable 1 => CP[playerid] = 1;
and set a race checkpoint
after that do something like that:
public OnPlayerEnterRaceCheckpoint(playerid)
{
new CP[MAX_PLAYERS];
if(CP[playerid] == 1)
{
CP[playerid] = 2;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,);
}
else if(CP[playerid] == 2)
{
CP[playerid] = 3;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,);
}
And continue ....
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
Fredden1993 - 18.12.2010
Quote:
Originally Posted by akis_tze
Take a variable for the player
Example: Make something like that
when the player type /licenseexam
make his variable 1 => CP[playerid] = 1;
and set a race checkpoint
after that do something like that:
public OnPlayerEnterRaceCheckpoint(playerid)
{
new CP[MAX_PLAYERS];
if(CP[playerid] == 1)
{
CP[playerid] = 2;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,);
}
else if(CP[playerid] == 2)
{
CP[playerid] = 3;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,);
}
And continue ....
|
I'll try, stand-by :P
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
Fredden1993 - 18.12.2010
I got it but I don't understand how the SetPlayerRaceCheckpoint works, I took time to check the wiki but it didn't make sense.
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
WillyP - 18.12.2010
Use a switch, not else if ect..
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
akis_tze - 18.12.2010
Quote:
Originally Posted by Fredden1993
I got it but I don't understand how the SetPlayerRaceCheckpoint works, I took time to check the wiki but it didn't make sense.
|
Example:
SetPlayerRaceCheckpoint(playerid,2,2321.4792,-2119.4358,12.7224,0,0,0,8.0);
Change 2321.4792,-2119.4358,12.7224 with your own the other leave it same..
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
Fredden1993 - 18.12.2010
I made something but it doesn't switch checkpoints when I enter the first one.
pawn Код:
new LicenseCheckpoint[MAX_PLAYERS];
if(strcmp(cmd, "/test", true) == 0)
{
LicenseCheckpoint[playerid] = 1;
SetPlayerRaceCheckpoint(playerid, 0, 1067.0742, 1375.4685, 10.7883, 0, 0, 0, 5.0);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(LicenseCheckpoint[playerid] == 1)
{
LicenseCheckpoint[playerid] = 2;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, 1019.1244, 1375.8406, 10.7023, 0, 0, 0, 5.0);
}
else if(LicenseCheckpoint[playerid] == 2)
{
LicenseCheckpoint[playerid] = 3;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, 1005.0032, 1205.0677, 10.6719, 0, 0, 0, 5.0);
}
return 1;
}
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
akis_tze - 18.12.2010
wrong public OnPlayerEnterCheckpoint
do it OnPlayerEnterRaceCheckpoint
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
Fredden1993 - 18.12.2010
Great, it works!
Now to the last part, I'm trying to modify the command to check if the play is in a license vehicle, but it doesn't work.
pawn Код:
if(strcmp(cmd, "/test", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You are not logged in yet.");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid >= LicenseCar[lc1] && vehicleid <= LicenseCar[lc2])
{
LicenseCheckpoint[playerid] = 1;
SetPlayerRaceCheckpoint(playerid, 0, 1067.0742, 1375.4685, 10.7883, 0, 0, 0, 5.0);
}
}
return 1;
}
Re: [HELP] Checkpoints, checkpoints, checkpoints :P -
akis_tze - 18.12.2010
Код:
if(strcmp(cmd, "/test", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You are not logged in yet.");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid >= LicenseCar[lc1] || vehicleid <= LicenseCar[lc2])
{
LicenseCheckpoint[playerid] = 1;
SetPlayerRaceCheckpoint(playerid, 0, 1067.0742, 1375.4685, 10.7883, 0, 0, 0, 5.0);
}
}
return 1;
}
Try this!