16.05.2011, 19:15
I have this code I found on LARP GM:
And if I try to write "/job" it writes me the taxi, bus, cop, medic, limo, sex, fire .... and if I type "/job medic" - its sais UNKNOWN COMMAND, what is the problem ?
Thank you very much!
Код:
if(strcmp(cmdtext, "/job", true) == 0) { new job[64]; new giveplayer[MAX_PLAYER_NAME]; new string[256]; job = strtok(cmdtext, idx); if(IsPlayerConnected(playerid)) { if(!strlen(job)){ SendClientMessage(playerid, COLOR_GREEN, "* ------------ /job ------------ *"); SendClientMessage(playerid, COLOR_WHITE, "taxi, bus, cop, medic, limo, sex, fire :афщшейеъ оъчбмеъ"); SendClientMessage(playerid, COLOR_GREEN, "* --------------------------------- *"); return 1; } if(strcmp(job,"medic",true) == 0) { if(PlayerInfo[playerid][pJob] == 6) { if(MedicCallTime[playerid] > 0) { SendClientMessage(playerid, COLOR_GREY, " You have already accepted a Medic Call !"); return 1; } if(medicCall < 999) { if(IsPlayerConnected(medicCall)) { GetPlayerName(medicCall, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* You have accepted the Medic Call from %s, you have 30 Seconds to get there.",giveplayer); SendClientMessage(playerid, COLOR_WHITE, string); SendClientMessage(playerid, COLOR_WHITE, "* After the 30 Seconds the Red Marker will dissapear."); format(string, sizeof(string), "* Medic %s has accepted your Medic Call please wait at your current Position.","d"); SendClientMessage(medicCall, COLOR_WHITE, string); new Float:X,Float:Y,Float:Z; GetPlayerPos(medicCall, X, Y, Z); SetPlayerCheckpoint(playerid, X, Y, Z, 5); GameTextForPlayer(playerid, "~w~Medic Caller~n~~r~Goto redmarker", 5000, 1); MedicCallTime[playerid] = 1; medicCall = 999; return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " No-one called for a Medic yet !"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a Medic !"); return 1; } } else { return 1; } }//not connected return 1; }
Thank you very much!