Wired problem in zcmd..
#1

SOLVED-
Reply
#2

I think you need to use OnPlayerCommandRecieved. Returning 0 there will prevent the command from being performed.
Reply
#3

I never had a problem with this using zcmd seems wierd, at least try this

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new string[60]; //Name + the Message
    if(!success) return format(string, sizeof(string), "(%s) Invalid Server Command", cmdtext), SendClientMessage(playerid, -1, string);
    if(!LoggedIn[playerid]) return SendClientMessage(playerid, -1,"You need to login to use this command");
    return 1;
}
Reply
#4

Tried both, non has worked.
EDIT: Check my code above, I've posted my OnPlayerCommandPerformed.
Reply
#5

Actually OnPlayerCommandReceived is the correct callback.
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(!LoggedIn[playerid])
    {
        SendClientMessage(playerid,COLOR_GREEN,"You have to login first");
        return 0;
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by iggy1
Посмотреть сообщение
I think you need to use OnPlayerCommandRecieved. Returning 0 there will prevent the command from being performed.
Answer

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{

    if(!LoggedIn[playerid])
        return !SendClientMessage(playerid,COLOR_GREEN,"You have to login first");

    return 1;
}
Reply
#7

Quote:
Originally Posted by iggy1
Посмотреть сообщение
I think you need to use OnPlayerCommandRecieved. Returning 0 there will prevent the command from being performed.
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Actually OnPlayerCommandReceived is the correct callback.
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(!LoggedIn[playerid])
    {
        SendClientMessage(playerid,COLOR_GREEN,"You have to login first");
        return 0;
    }
    return 1;
}
Quote:
Originally Posted by Jefff
Посмотреть сообщение
Answer

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{

    if(!LoggedIn[playerid])
        return !SendClientMessage(playerid,COLOR_GREEN,"You have to login first");

    return 1;
}
lol, my bad..
i tried iggy's post in a wrong way. sorry :\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)