24.07.2015, 12:00
i've made a command for /callsign,
i made it so it checks to see if the player isacop and if he is it allows him to attach a callsign, i did this and went in game to test and i made myself LSPD, and did /callsign and it just said the error message of You're not a cop. im confused and need help. thank you.
i made it so it checks to see if the player isacop and if he is it allows him to attach a callsign, i did this and went in game to test and i made myself LSPD, and did /callsign and it just said the error message of You're not a cop. im confused and need help. thank you.
Код:
CMD:callsign(playerid, params[]) { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); new string[32]; if(IsPlayerInVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You're not in a vehicle."); if(IsACop(playerid) || IsALVMPDCop(playerid) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a police officer."); if (IsACopCar(vehicleid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be inside a police cruiser."); if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 1) { Delete3DTextLabel(vehicle3Dtext[vehicleid]); vehiclecallsign[vehicleid] = 0; SendClientMessage(playerid, COLOR_RED, "Callsign removed."); return 1; } if(sscanf(params, "s[32]",string)) return SendClientMessageEx(playerid, COLOR_GREY, "You must enter a callsign."); if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 0) { vehicle3Dtext[vehicleid] = Create3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.0, 10.0, 0, 1); Attach3DTextLabelToVehicle(vehicle3Dtext[vehicleid], vehicleid, 0.0, -2.8, 0.0); vehiclecallsign[vehicleid] = 1; } return 1; }
Код:
IsACop(playerid) { if(IsPlayerConnected(playerid)) { new leader = PlayerInfo[playerid][pLeader]; new member = PlayerInfo[playerid][pMember]; if(member==1 || member==2 || member== 3 || member==7 || member==11 || member==13 || member==18 || member==19) { return 1; } else if(leader==1 || leader==2 || leader == 3 || leader==7 || leader==11 || leader==13 || leader==18 || leader==19) { return 1; } } return 0; }
Код:
IsACopCar(carid) { for(new v = 0; v < sizeof(LSPDVehicles); v++) { if(carid == LSPDVehicles[v]) return 1; } return 0; }