03.11.2013, 07:54
Ola , esses codigos /setscore e /setcash sу funciona logado na rcon, gostaria de colcoar para adm lvl5 usar sem estar logado na rcon. irei deixar os codigos abaixo.
OBRIGADO!
Код:
dcmd_setcash(playerid, params[]) { if (PlayerInfo[playerid][Level] >= 5) { if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "[ERRO]: Vocк nгo tem permissгo para isso"); new tmp[256], tmp2[256], Index; tmp = strtok(params, Index), tmp2 = strtok(params, Index); if (!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USO: /setcash [playerid] [amount]"); new player1 = strval(tmp), cash = strval(tmp2), string[128]; if (PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid, red, "[ERRO]: Voce deve ser admin de nivel maior"); if (IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { CMDMessageToAdmins(playerid, "SETCASH"); format(string, sizeof(string), "Voce definiu \"%s's\" de dinheiro para '$%d", pName(player1), cash); SendClientMessage(playerid, blue, string); if (player1 != playerid) { format(string, sizeof(string), "Administrador (a) \"%s\" configurou seu dinheiro para '$%d'", pName(playerid), cash); SendClientMessage(player1, blue, string); } ResetPlayerCash(player1); GivePlayerCash(player1, cash); return 1; } else return SendClientMessage(playerid, red, "[ERRO]: Jogador nao conectado"); } else return SendClientMessage(playerid, red, "[ERRO]: Vocк nгo tem permissгo para isso"); } dcmd_setscore(playerid, params[]) { if (PlayerInfo[playerid][Level] >= 5) { if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "[ERRO]: Vocк nгo tem permissгo para isso"); new tmp[256], tmp2[256], Index; tmp = strtok(params, Index), tmp2 = strtok(params, Index); if (!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USO: /setscore [playerid] [score]"); new player1 = strval(tmp), score = strval(tmp2), string[128]; if (PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid, red, "[ERRO]: Voce deve ser admin de nivel maior"); if (IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { CMDMessageToAdmins(playerid, "SETSCORE"); format(string, sizeof(string), "Voce definiu \"%s's\" de pontos para '%d' ", pName(player1), score); SendClientMessage(playerid, blue, string); if (player1 != playerid) { format(string, sizeof(string), "Administrador (a) \"%s\" definiu seus pontos para '%d'", pName(playerid), score); SendClientMessage(player1, blue, string); } return SetPlayerScore(player1, score); } else return SendClientMessage(playerid, red, "[ERRO]: Jogador nao conectado"); } else return SendClientMessage(playerid, red, "[ERRO]: Vocк nгo tem permissгo para isso"); }