Y_Commands: all commands disabled for all players - 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: Y_Commands: all commands disabled for all players (
/showthread.php?tid=398506)
Y_Commands: all commands disabled for all players -
deb014 - 09.12.2012
Hi, this is my problem: As the title says, I use YCMD. As is normal, I combine it with Y_groups for restrict commands, for example, only to admins, only to team X, only to team Y, etc. But when I run the code and I try to execute any command in game, I am disallowed to execute it (also if is a global command like /chat). I don't know what I am doing wrong, thanks for read, and thanks in advance if you have any possible solution.
Re: Y_Commands: all commands disabled for all players -
HireMe - 09.12.2012
Can you show us the script / part of the script with some commands?
Re: Y_Commands: all commands disabled for all players -
deb014 - 09.12.2012
Quote:
Originally Posted by HireMe
Can you show us the script / part of the script with some commands?
|
of course...
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(!PlayerIsLoggedIn[playerid]){
SendClientMessage(playerid, -1, "Please log in!");
return -1;
}
return 1;
}
here the commands part, something like...
pawn Код:
YCMD:commands(playerid, params[], help)
{
if ( help ) return SendClientMessage(playerid, -1, "Shows the command list");
new count = Command_GetPlayerCommandCount( playerid ), cmd[32];
for ( new i = 0; i != count; ++i){
format(cmd, sizeof(cmd), "/%s ", Command_GetNext ( i, playerid ));
SendClientMessage(playerid, -1, cmd);
}
return 1;
}
finally...
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success){
switch (success)
{
case 1:
{
return 1;
}
case -1:
{
return 0;
}
case 0:
{
SendClientMessage(playerid, -1, "Command not found, please use /commands to display the command list.");
return 1;
}
default:
return -1;
}
return 1;
}