09.11.2009, 23:45
SORRY IT LOOKS MESSED UP
EDIT: it does compile but it says unreachable code so idk please help
Код:
if(strcmp(cmd, "/givelicense", true) == 0) { if (PlayerInfo[playerid][pAdmin] >= 3) { if(IsPlayerConnected(playerid)) { { //SendClientMessage(playerid, COLOR_GREY, " Only Rank 2 or higher can give away a License !"); return 1; } new x_nr[256]; //..............THIS IS WHERE IT SAYS UNREACHABLE............... x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense [name] [playerid/PartOfName] [price]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving, Flying, Sailing, Fishing."); return 1; } if(strcmp(x_nr,"driving",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense driverslicense [playerid/PartOfName] [price]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givelicense driving [playerid/ParOfName] [price]"); return 1; } new price; price = strval(tmp); if(price < 50 || price > 500) { SendClientMessage(playerid, COLOR_GREY, " Price not lower then 50, or above 500!"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* You've given a Drivers License to %s.",giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Instructor %s has given you a Drivers License.",sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); PlayerInfo[giveplayerid][pCarLic] = 1; format(string, sizeof(string), "* You offerd %s to buy drivers license for $%d .", giveplayer, price); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "* School instructor %s wants to sell you drivers license for $%d,(type /accept license) to buy.", sendername, price); SendClientMessage(giveplayerid, COLOR_WHITE, string); LicenseOffer[giveplayerid] = playerid; LicensePrice[giveplayerid] = price; LicenseType[giveplayerid] = 1; return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " That player is Offline !"); return 1; } }