04.08.2014, 22:16
This is the code:
I wanted to make the command return a value if a player is already doing the exam, like this :
Though only errors pop up when i stick it between the first to ifs, can someone help ?
Код:
CMD:takeexam(playerid, params[]) { if(PlayerInfo[playerid][pDriveLic] == 1) return SCM(playerid, COLOR_GREY,"You already have a drivers license."); if(IsPlayerInVehicle(playerid, dmvc) || IsPlayerInVehicle(playerid, dmvc1) || IsPlayerInVehicle(playerid,dmvc2) || IsPlayerInVehicle(playerid,dmvc3) || IsPlayerInVehicle(playerid,dmvc4)) { TogglePlayerControllable(playerid, 1); CP[playerid] = 200; SetPlayerCheckpoint(playerid, -236.8177,1195.2351,19.3732, 4.0); TakingLesson[playerid] = 1; SendClientMessage(playerid, COLOR_LIGHTBLUE, "DMV: Please follow the checkpoints and drive safely !"); } else return SCM(playerid, COLOR_GREY,"You are not in a DMV car."); return 1; }
Код:
if(TakingLesson[playerid] = 1) return SCM(playerid, COLOR_GREY,"You already are taking the driving exam.");