[Ajuda] Codigo /setscore e /setcash
#1

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.

Код:
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");
}
OBRIGADO!
Reply


Messages In This Thread
Codigo /setscore e /setcash - by Gefe13 - 03.11.2013, 07:54
Re: Codigo /setscore e /setcash - by powerths - 03.11.2013, 08:56
Re: Codigo /setscore e /setcash - by Gefe13 - 03.11.2013, 09:01
Respuesta: Re: Codigo /setscore e /setcash - by DanDRT - 03.11.2013, 10:56
Re: Codigo /setscore e /setcash - by PT - 03.11.2013, 11:29
Re: Codigo /setscore e /setcash - by luancalixto - 03.11.2013, 11:49
Re: Codigo /setscore e /setcash - by Gefe13 - 03.11.2013, 12:24
Re: Codigo /setscore e /setcash - by PT - 03.11.2013, 12:35
Re: Codigo /setscore e /setcash - by JoaoMonteiro452 - 03.11.2013, 13:27

Forum Jump:


Users browsing this thread: 1 Guest(s)