SA-MP Forums Archive
HELP A BIT ("You need to login first before using any command.") - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP A BIT ("You need to login first before using any command.") (/showthread.php?tid=615399)



HELP A BIT ("You need to login first before using any command.") - Scrillex - 21.08.2016

CMD all the time shows :"You need to login first before using any command." It is set to 1.... Under spawn, login dialog
pawn Код:
new Logged[ MAX_PLAYERS ];




YCMD:giverespect(playerid, params[],help)
{
    if(Logged[playerid] == 1) SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    else if(PlayerInfo[playerid][pCMDT] > 0) SendClientMessage(playerid,0xFF0000FF,"Please wait before using this command again.");
    else{
        new id;
        if(sscanf(params, "u", id)) SendClientMessage(playerid, 0xCC0000AA, "USAGE: /respect <playerid/partofname>");
        else if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) SendClientMessage(playerid, -1, "ID not connected");
        else if(playerid == id) SendClientMessage(playerid, -1, "You can't heal yourself.");
        else if(!IsPlayerInRangeOfPlayer(playerid, id, 5)) SendClientMessage(playerid, -1, "You aren't close enough to the player.");
        else{
            new string[128];
            PlayerInfo[playerid][pStreetRespect]++;
            PlayerInfo[playerid][pCMDT] = 3600; // example 3600 - 1 hour
            format(string, sizeof(string), " You have gived Street Respect to %s.", NORPN(id));
            SendClientMessage(playerid, COLOR_WHITE, string);
            format(string, sizeof(string), " Player %s has gived you Street Respect to you.", NORPN(playerid));
            SendClientMessage(id, COLOR_WHITE, string);
        }
    }
    return 1;
}



Re: HELP A BIT ("You need to login first before using any command.") - Mauzen - 21.08.2016

Shouldnt it be

if(Logged[playerid] == 0)

if it is set to 1 on login?


Re: HELP A BIT ("You need to login first before using any command.") - Scrillex - 21.08.2016

Soz stupid mistake....