30.10.2013, 14:15
(
Последний раз редактировалось [D]ry[D]esert; 30.10.2013 в 16:07.
)
SOLVED-
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;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(!LoggedIn[playerid])
{
SendClientMessage(playerid,COLOR_GREEN,"You have to login first");
return 0;
}
return 1;
}
I think you need to use OnPlayerCommandRecieved. Returning 0 there will prevent the command from being performed.
|
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(!LoggedIn[playerid])
return !SendClientMessage(playerid,COLOR_GREEN,"You have to login first");
return 1;
}
I think you need to use OnPlayerCommandRecieved. Returning 0 there will prevent the command from being performed.
|
Actually OnPlayerCommandReceived is the correct callback.
pawn Код:
|
Answer
pawn Код:
|