Need help!
#1

pawn Код:
CMD:pauser(playerid, params[])
{
    new player, pName[MAX_PLAYER_NAME];
    if( sscanf ( params, "u", player)) return SendClientMessage(playerid, -1, "Usage: /pauser [ playerid ]");
    if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID)
    {
        if(afksecs[ player ] < 2)
        {
            if(afksecs[ player ] > 2)
            {
                new str[ 75 ];
                GetPlayerName(player, pName, MAX_PLAYER_NAME);
                format(str, 75, "%s[%d] has been afk for %d seconds ", pName, player, afksecs[ player ]);
                SendClientMessage(playerid, -1, str);
            }else return afksecs[player];
        }
    }else return SendClientMessage(playerid, -1, "This player is not connected..");
    return SendClientMessage(playerid, -1, "This player is not pausing!");
}
Ah well, there is no warnings / errors, I don't know how to return the seconds a player has been afk e.g "afksecs[ playerid ]" wich will return the format if the player is afk, i made it as it's stated above, but it returns "This player is not connected" when the playerid is a valid id, any reason? Please help.
Reply
#2

First of all:

pawn Код:
if(afksecs[ player ] < 2)
        {
            if(afksecs[ player ] > 2)
?
Reply
#3

Are you dumb? the first one is to detect if he's pausing or not...

if get seconds its minus than 2.. then the player is not pausing, but if the seconds are more than 2, the player is pausing KAPISHI?
Reply
#4

Returning the varibale won't do anything:
Try this:
pawn Код:
CMD:pauser(playerid, params[])
{
    new player, pName[MAX_PLAYER_NAME];
    if( sscanf ( params, "u", player)) return SendClientMessage(playerid, -1, "Usage: /pauser [ playerid ]");
    if(!IsPlayerConnected(player) || player == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "This player is not connected..");
    if(afksecs[ player ] > 1)
    {
        new str[ 75 ];
        GetPlayerName(player, pName, MAX_PLAYER_NAME);
        format(str, 75, "%s[%d] has been afk for %d seconds ", pName, player, afksecs[ player ]);
        SendClientMessage(playerid, -1, str);
    }
    else return SendClientMessage(playerid, -1, "This player is not pausing!");
    return 1;
}
Reply
#5

Quote:
Originally Posted by Strier
Посмотреть сообщение
Are you dumb? the first one is to detect if he's pausing or not...

if get seconds its minus than 2.. then the player is not pausing, but if the seconds are more than 2, the player is pausing KAPISHI?
You actually did it wrong. go look at your code.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)