License Test -
AhmedMohamed - 30.03.2014
hello all I made license test system but I have problem in when the player take the car he must go to the first checkpoint and then the second one etc. , but when the player go to the first one the second doesn't appear
here is the code:
pawn Код:
if(CP[playerid] == 1) // Drivers License Test
{
if(IsPlayerInRangeOfPoint(playerid,5,980.1932,-1407.9902,13.0956)) // Checkpoint 1
{
SetPlayerCheckpoint(playerid,1009.3680,-1407.4510,13.0299,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1009.3680,-1407.4510,13.0299)) // Checkpoint 2
{
SetPlayerCheckpoint(playerid,1035.6870,-1407.1594,13.1585,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1035.6870,-1407.1594,13.1585)) // Checkpoint 3
{
SetPlayerCheckpoint(playerid,1058.1282,-1412.7396,13.3948,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1058.1282,-1412.7396,13.3948)) // Checkpoint 4
{
SetPlayerCheckpoint(playerid,1059.2937,-1435.7738,13.3568,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1059.2937,-1435.7738,13.3568)) // Checkpoint 5
{
SetPlayerCheckpoint(playerid,1056.1156,-1456.7148,13.3670,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1056.1156,-1456.7148,13.3670)) // Checkpoint 6
{
SetPlayerCheckpoint(playerid,1012.2074,-1438.6262,13.5469,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1012.2074,-1438.6262,13.5469)) // Checkpoint 7
{
SetPlayerCheckpoint(playerid,1026.7972,-1443.0872,13.5546,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1026.7972,-1443.0872,13.5546)) // Checkpoint 8
{
SetPlayerCheckpoint(playerid,1026.6116,-1433.3167,13.5469,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1026.6116,-1433.3167,13.5469)) // Checkpoint 9
{
SetPlayerCheckpoint(playerid,1004.7498,-1439.7341,13.5469,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,1004.7498,-1439.7341,13.5469)) // Checkpoint 10
{
SetPlayerCheckpoint(playerid,967.4974,-1443.5815,13.5041,5);
}
if(IsPlayerInRangeOfPoint(playerid,5,967.4974,-1443.5815,13.5041)) // Checkpoint 12
{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
if(Health > 900)
{
DisablePlayerCheckpoint(playerid);
PlayerInfo[playerid][pCarLic] = 1;
LicenseTest[playerid] = 0;
CP[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have successfully passed the test and received your license.");
}
else
{
DisablePlayerCheckpoint(playerid);
LicenseTest[playerid] = 0;
CP[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have damaged your vehicle hardly, therefore you failed the test.");
}
}
}
else DisablePlayerCheckpoint(playerid);
return 1;
}
the command to go in the test:
pawn Код:
CMD:testlic(playerid,params[])
{
if(LicenseTest[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are already in the License Test");
if(LicenseTest[playerid] == 0 && IsPlayerInRangeOfPoint(playerid, 5, 957.5546,-1442.5096,14.0535))
{
LicenseTest[playerid] = 1;
SetPlayerCheckpoint(playerid,957.5525,-1421.1719,13.5469, 5);
SendClientMessage(playerid, COLOR_YELLOW, "Choose a car from these cars behind the CheckPoint");
}else return SendClientMessage(playerid, COLOR_GREY, "You are not at License Test Pickup");
return 1;
}
Re: License Test -
luis_mendoza - 30.03.2014
Try doing it like this ...
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,5,980.1932,-1407.9902,13.0956)) // Checkpoint 1
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1009.3680,-1407.4510,13.0299,5);
}
//and so on
I use to do things like that and it is working with this way.
Re: License Test -
AhmedMohamed - 30.03.2014
not working
Re: License Test -
luis_mendoza - 30.03.2014
This is one of mine working
pawn Код:
if(PlayerToPoint(7.0, playerid, 1823.5610,-1837.4493,12.9758))
{
if(Bustor[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1703.8719,-1810.4819,12.9258, 5.0);
}
}
if(PlayerToPoint(7.0, playerid, 1703.8719,-1810.4819,12.9258))
{
if(Bustor[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1692.0139,-1744.6976,12.9660, 5.0);
}
}
Try replacing it with PlayerToPoint (or it is the same - i'm really confused now)
Re: License Test -
AhmedMohamed - 30.03.2014
read that :
https://sampwiki.blast.hk/wroot/index.ph...nt&redirect=no
WELL
Respuesta: License Test -
OTACON - 30.03.2014
pawn Код:
public OnPlayerEnterCheckpoint(playerid){
if(LicenseTest[playerid] == 1){
CP[playerid]++;
DisablePlayerCheckpoint(playerid);
switch(CP[playerid]){
case 1:{SetPlayerCheckpoint(playerid,1009.3680,-1407.4510,13.0299,5);}
case 2:{SetPlayerCheckpoint(playerid,1035.6870,-1407.1594,13.1585,5);}
case 3:{SetPlayerCheckpoint(playerid,1058.1282,-1412.7396,13.3948,5);}
case 4:{SetPlayerCheckpoint(playerid,1059.2937,-1435.7738,13.3568,5);}
case 5:{SetPlayerCheckpoint(playerid,1056.1156,-1456.7148,13.3670,5);}
case 6:{SetPlayerCheckpoint(playerid,1012.2074,-1438.6262,13.5469,5);}
case 7:{SetPlayerCheckpoint(playerid,1026.7972,-1443.0872,13.5546,5);}
case 8:{SetPlayerCheckpoint(playerid,1026.6116,-1433.3167,13.5469,5);}
case 9:{SetPlayerCheckpoint(playerid,1004.7498,-1439.7341,13.5469,5);}
case 10:{SetPlayerCheckpoint(playerid,967.4974,-1443.5815,13.5041,5);}
case 11:{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
if(Health > 900){
DisablePlayerCheckpoint(playerid);
PlayerInfo[playerid][pCarLic] = 1;
LicenseTest[playerid] = 0;
CP[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have successfully passed the test and received your license.");
}
else{
DisablePlayerCheckpoint(playerid);
LicenseTest[playerid] = 0;
CP[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have damaged your vehicle hardly, therefore you failed the test.");
}
}
}
}
return 1;
}
CMD:testlic(playerid,params[]){
if(LicenseTest[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are already in the License Test");
if(LicenseTest[playerid] == 0 && IsPlayerInRangeOfPoint(playerid, 5, 957.5546,-1442.5096,14.0535)){
LicenseTest[playerid] = 1;
SetPlayerCheckpoint(playerid,957.5525,-1421.1719,13.5469, 5);
SendClientMessage(playerid, COLOR_YELLOW, "Choose a car from these cars behind the CheckPoint");
}else return SendClientMessage(playerid, COLOR_GREY, "You are not at License Test Pickup");
return 1;
}
Re: License Test -
VerticalGaming - 30.03.2014
I'm Faff, (Creator of the gamemode you're using. LSC-RP).
I've solved it by simply removing ALL checkpoints, and re-scripted the whole driving licenses system.
Re: License Test -
AhmedMohamed - 31.03.2014
if you are really Faff please contact me on my skype because i wanna ask you some question or pm me
thank you mate
Skype: noname_redfairy
Re: License Test -
AhmedMohamed - 31.03.2014
and REP+ OTACON