Posts: 13
Threads: 6
Joined: May 2016
Reputation:
0
Someone will help? When I'm in the arena and wants to go out with the command / aexit writes "you are in the arena enter / aexit"
if(BlockArena[playerid] >= 1)
{
if(strfind(params,"/aexit",true) == 0) return 1;
SendClientMessage(playerid,COLOR_RED2, "›› |błąd| Jesteś na arenie wpisz /aexit.");
return 0;
}
Posts: 78
Threads: 24
Joined: Jul 2016
Reputation:
0
I'll resume this in one word:
Amaaaazing.
їYou will develope more versions/updates?
Posts: 1,915
Threads: 64
Joined: Jan 2016
Reputation:
0
Can we deactivate commands per player?
Posts: 270
Threads: 7
Joined: Apr 2015
Server doesn't need fast command processing...
Developer needs a command processor that is simple and fast to develop not fast to process.
Posts: 71
Threads: 4
Joined: Nov 2016
Reputation:
0
How can I create a command? I know only ZCMD style.
Posts: 293
Threads: 20
Joined: Jan 2017
I've replaced ZCMD with this one in linux, and it works like a charm, fast AF.
but in Windows...
Код:
[00:26:55]----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, ©2005-2015 SA-MP Team
[00:26:50]
[00:26:50] Server Plugins
[00:26:50] --------------
[00:26:50] Loading plugin: crashdetect
[00:26:50] CrashDetect v4.13.1 is OK.
[00:26:50] Loaded.
[00:26:50] Loading plugin: mysql_static
[00:26:50] Failed.
[00:26:50] Loading plugin: mysql
[00:26:50] >> plugin.mysql: R39-3 successfully loaded.
[00:26:50] Loaded.
[00:26:50] Loading plugin: sscanf
[00:26:50]
[00:26:50] ===============================
[00:26:50] sscanf plugin loaded.
[00:26:50] Version: 2.8.1
[00:26:50] © 2012 Alex "Y_Less" Cole
[00:26:50] ===============================
[00:26:50] Loaded.
[00:26:50] Loading plugin: streamer
[00:26:50] Failed.
[00:26:50] Loading plugin: pawncmd
[00:26:50] Pawn.CMD plugin v3.1.2 by urShadow loaded
[00:26:50] Loaded.
[00:26:50] Loading plugin: nativechecker
[00:26:50] Loaded.
[00:26:50] Loaded 5 plugins.
[00:26:50]
[00:26:50] Filterscripts
[00:26:50] ---------------
[00:26:50] Loaded 0 filterscripts.
[00:26:55] [debug] Server crashed due to an unknown error
[00:26:56] [debug] Native backtrace:
[00:26:56] [debug] #0 012922f7 in ?? () from plugins\pawncmd.dll
[00:26:56] [debug] #1 012945fb in ?? () from plugins\pawncmd.dll
[00:26:56] [debug] #2 00469ab5 in ?? () from samp-server.exe
[00:26:56] [debug] #3 65646f6d in ?? () from samp-server.exe
( Off topic, don't ask for time in debug, it's real. I try to stay awake these days to focus on coding lol )
Posts: 1,506
Threads: 13
Joined: Jun 2015
Quote:
Originally Posted by Bussyman
Код:
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
{
if(result == -1)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command.");
return 0;
}
return 1;
}
result only returns -1 ?
|
No, the result returns whatever the value is returned from the command. For example, if you want to make something like this...
PHP код:
CMD:ajetpack(playerid)
{
if(pInfo[playerid][AdminLvl] < 2) return 0; // this will send result value as 0.
if(!AdmDuty{playerid}) return SendClientMessage(playerid, COLOR_RED, "ERROR: "COL_GREY"You must be on admin duty to use this command."), 0; // this will send result value as 0 as well.
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
SendClientMessage(playerid, COLOR_PINK, "* Spawned Jetpack.");
return 1; // this will send result value as 1.
}
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
{
if(!result) // if result is zero
return SendClientMessage(playerid, COLOR_RED, "ERROR: You're not permitted to use this command.");
return 1;
}
Result value can be important, and if you use flags along with it, it might make your code better (This is just an example.) Result only comes up as -1 when the command doesn't exist, otherwise as said it'll return the result passed in the command.
--------
Is PC_EmulateCommand supposed not to call "OnPlayerCommandPerformed"? Because it doesn't calls for me.
Posts: 159
Threads: 103
Joined: Apr 2017
Reputation:
0
What if in command return -1;? so in callback if(result == -1) will do check? and why
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
{
if(result == -1)
{
return 0;
}
return 1;
}
Why need return 0;? is there effect anything?
Posts: 190
Threads: 28
Joined: Jun 2017