17.05.2011, 19:24
Код:
if(strcmp(cmd, "/setex", true) == 0) { tmp = strtok(cmdtext, idx); giveplayerid = strval(tmp); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[playerid][pEX] = dini_Int(udb_encode(sendername), "levelex"); PlayerInfo[giveplayerid][pEX] = dini_Int(udb_encode(giveplayer), "levelex"); // vc colocou pro cara ser do exe apenas se tiver no dini dele giveplayerid = strval(tmp); if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 10) { SendClientMessage(playerid, COLOR_GREEN, "Uso correto: /setexc [id do player] [cargo]"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 10) { SendClientMessage(playerid, COLOR_GREEN, "Uso correto: /setexc [id do player] [cargo]"); return 1; } PlayerInfo[playerid][pEX] = dini_Int(udb_encode(sendername), "levelex"); levelex[playerid] = strval(tmp); // axo q agora ja funfa ok, vo testar if(levelex[playerid] < 0) { SendClientMessage(playerid, COLOR_CYAN, "Level de EXC invбlido!"); return 1; } if(levelex[playerid] > 6) { SendClientMessage(playerid, COLOR_CYAN, "Level de EXC invбlido!"); return 1; } if(levelex[playerid] == PlayerInfo[giveplayerid][pEX]) { format(string, sizeof(string), "Este player jб й um MILITAR DO EXERCITO !", levelex[playerid]); SendClientMessage(playerid, COLOR_CYAN, string); return 1; } if(logged[giveplayerid] == 1) { if(PlayerInfo[playerid][pAdmin] >= 11 || PlayerInfo[playerid][pEX] >= 4) { if(IsPlayerConnected(giveplayerid)) { if(logged[giveplayerid] == 0) { SendClientMessage(playerid, COLOR_CYAN, "O player tem que estar logado para poder receber o level de EXC!"); return 1; } else { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); dini_IntSet(udb_encode(giveplayer), "levelex", levelex[playerid]); format(string, sizeof(string), "Adm.Cmd: Vocк deu para %s um Cargo como MILITAR DO EXERCITO!", giveplayer); SendClientMessage(playerid, COLOR_CYAN, string); format(string, sizeof(string), "Adm.Cmd: Vocк foi promovido um MILITAR DO EXERCITO [Level %d] Por: %s.",levelex[playerid], sendername); SendClientMessage(giveplayerid, COLOR_CYAN, string); PlayerInfo[giveplayerid][pEX] = dini_Int(udb_encode(giveplayer), "levelex"); new PlayerName[30]; GetPlayerName(playerid, PlayerName, 30); printf("[Command] %s usou /setexc para dar par %s level %d de EXERCITO.", PlayerName, giveplayer, levelex[playerid]); } } else { format(string, sizeof(string), "%d nгo й o nъmero de ID de um player ativo!", giveplayerid); SendClientMessage(playerid, COLOR_CYAN, string); } } else { SendClientMessage(playerid, COLOR_CYAN, "Vocк nгo tem permissгo para usar este comando!"); } } else { SendClientMessage(playerid, COLOR_CYAN, "Vocк tem que estar logado para usar este comando!"); } return 1; }