public OnPlayerPickUpPickup(playerid, pickupid) { if(ParkourCP[playerid] == -1) return 1; if(ParkourPickups[ParkourCP[playerid]] == pickupid) { ParkourCP[playerid]++; if(ParkourCP[playerid] == sizeof(ParkourCheckpoints)) { ParkourCP[playerid] = -1; SetPlayerScore(playerid,GetPlayerScore(playerid) +1); // here you become a scorepoint SendClientMessage(playerid, 0xFACBADFF, "Youre finished the first parkour."); SendClientMessage(playerid, 0xFACBADFF, "You get 1 score. (/score)"); SendClientMessage(playerid, 0xFACBADFF, "Use `/parkour2` to start with the next."); RemovePlayerMapIcon(playerid, MAP_ICON_ID); } else { new string[12]; format(string, 12, "~b~CP:~w~%i", ParkourCP[playerid]); GameTextForPlayer(playerid, string, 3000, 5); SetPlayerMapIcon(playerid, MAP_ICON_ID, ParkourCheckpoints[ParkourCP[playerid]][0], ParkourCheckpoints[ParkourCP[playerid]][1], ParkourCheckpoints[ParkourCP[playerid]][2], 53, 0); } } return 1; } |
public OnPlayerCommandText(playerid, cmdtext[]) { if(GetPlayerScore(playerid) >= 1) // if have a score then make command, when not a score then block the command and send a warning { if(strcmp(cmdtext, "/parkour2", true) == 0) { ParkourCP[playerid] = 0; SetPlayerMapIcon(playerid, MAP_ICON_ID, ParkourCheckpoints[0][0], ParkourCheckpoints[0][1], ParkourCheckpoints[0][2], 53, 0); SetPlayerPos(playerid, 1847.0726,-1593.7416,15.4674); SetPlayerFacingAngle(playerid, 175.9439); SetCameraBehindPlayer(playerid); SetPlayerHealth(playerid, 97.6); return 1; } else { SendClientMessage(playerid,rot,"You must complete parkour 1. (/start)"); //message when you not have a scorepoint } return 1; } return 1; } |
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/somecmd")) { if(GetPlayerScore(playerid) != 1) return 0; // Rest of the cmd return 1; } }
public OnPlayerCommandText(playerid,cmdtext[]) { if(strcmp("/selfheal",cmdtext,true,9) == 0)//The cmd if(GetPlayerScore(playerid) != 1) { SendClientMessage(playerid,0xFFFFFF,"ERROR: Your score is not 1!");//If hes score is not 1 return 1; } else { SetPlayerHealth(playerid,100); SendClientMessage(playerid,0xFFFFFF,"Your health has been set to 100");//If hes score is 1 he will have hes HP set to 100 return 1; } return 1; }