SA-MP Forums Archive
Code aint working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Code aint working (/showthread.php?tid=191977)



Code aint working - iLcke - 21.11.2010

pawn Код:
if(IsADL(newcar))
{
if (drtest[playerid] != 0)
{
SendClientMessage(playerid, COLOR_RED, " You did not pay to take a test yet! ");
RemovePlayerFromVehicle(playerid);
return 1;
}
SendClientMessage(playerid, COLOR_GREEN, "Driving Instructor: Follow the Red markers and complete the track. Dont damage the car!");
drtest[playerid] = 2;
DLicense(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_DRTEST;
return 1;
}
I dont get errors, it just doesn't work ingame, ideas?


Re: Code aint working - randomkid88 - 21.11.2010

Try putting an else if set around the test part. Like:

pawn Код:
if(IsADL(newcar))
{
     if (drtest[playerid] != 0)
     {
          SendClientMessage(playerid, COLOR_RED, " You did not pay to take a test yet! ");
          RemovePlayerFromVehicle(playerid);
          return 1;
     }
     else
     {
          SendClientMessage(playerid, COLOR_GREEN, "Driving Instructor: Follow the Red markers and complete the     track. Dont damage the car!");
          drtest[playerid] = 2;
          DLicense(playerid);
          gPlayerCheckpointStatus[playerid] = CHECKPOINT_DRTEST;
          return 1;
     }
}



Re: Code aint working - Grim_ - 21.11.2010

@ randomkid: I appreciate you trying to help, but you are only going to give him more errors then solutions.

What do you mean "It's not working"? Is it not removing the player from the vehicle? Details, details, and more details cannot hurt you in any way!


Re: Code aint working - iLcke - 21.11.2010

It doesn't eject them.


Re: Code aint working - randomkid88 - 21.11.2010

Quote:
Originally Posted by Grim_
Посмотреть сообщение
@ randomkid: I appreciate you trying to help, but you are only going to give him more errors then solutions.
I don't see how that would give errors.

But yes, details help.


Re: Code aint working - iggy1 - 21.11.2010

Quote:
Originally Posted by randomkid88
Посмотреть сообщение
I don't see how that would give errors.

But yes, details help.
For a start "else if" should have a condition.


Re: Code aint working - randomkid88 - 21.11.2010

Quote:
Originally Posted by iggy1
Посмотреть сообщение
For a start "else if" should have a condition.
Touche. I meant for it to be else.