08.08.2016, 13:42
Quote:
pawn Код:
pawn Код:
|
OFF: Multumesc batrane, stiu ca tot nu ma suporti )
pawn Код:
pawn Код:
|
pawn Код:
pawn Код:
|
[00:45:19] [debug] Server crashed while executing rpg.amx [00:45:19] [debug] AMX backtrace: [00:45:19] [debug] #0 native CallLocalFunction () from samp-server.exe [00:45:19] [debug] #1 000632c0 in public OnDialogResponse (0, 30, 1, 2, 9299988) from rpg.amx [00:45:19] [debug] Native backtrace: [00:45:19] [debug] #0 0047467c in ?? () from samp-server.exe [00:45:19] [debug] #1 004010b6 in ?? () from samp-server.exe [00:45:19] [debug] #2 745462ca in AmxCallback () from plugins\crashdetect.DLL [00:45:19] [debug] #3 74548b28 in amx_Exec () from plugins\crashdetect.DLL [00:45:19] [debug] #4 745409c7 in CrashDetect::DoAmxExec () from plugins\crashdetect.DLL [00:45:19] [debug] #5 7454631a in AmxExec () from plugins\crashdetect.DLL [00:45:19] [debug] #6 744d51b9 in ?? () from plugins\streamer.DLL [00:45:19] [debug] #7 0046ec31 in ?? () from samp-server.exe [00:45:19] [debug] #8 00452270 in ?? () from samp-server.exe [00:45:19] [debug] #9 0049eef9 in ?? () from samp-server.exe [00:45:19] [debug] #10 004aa31e in ?? () from samp-server.exe
pc_cmd_setinterior(playerid, "0 5");
callcmd::setinterior(playerid, "0 5");
pc_cmd_setinterior(playerid, "0 PlayerInfo [playerid][pInterior]"); ?
Mister0 you can't send NULL in CallLocalFunction "s", "\0" ); ;d read wiki about this, just use
pawn Код:
pawn Код:
|
Can I use this?
Код:
pc_cmd_setinterior(playerid, "0 PlayerInfo [playerid][pInterior]"); ? |
format( string, 8, "0 %d", PlayerInfo[ playerid ][ pInterior ] ); pc_cmd_setinterior( playerid, string );
All of you are just wrong. There are functions and macros made for exactly what you want.
The callcmd macro and the PC_EmulateCommand function are both for calling commands like this. Don't call the function manually, that's not how the plugin was made to be treated. |
#define callcmd::%0(%1) pc_cmd_%0(%1)
PC_EmulateCommand is the only actual way to do it then. It's the only one that actually calls the legit command. It's the only one that will take all of this plugin's features into consideration.
Like Y_Less always said about this with YCMD, if a commands features are meant to be called anywhere other than the command then those features should be in a function of their own. Call that separate function from the command. There should be absolutely no need AT ALL to call a command callback manually. Also, I thought callcmd was a macro for PC_EmulateCommand. |
CallLocalFunction( cmd, "ds", playerid, "\1\0" );
tbh there is no such thing called "CMD" to pawn, it's just a word/string of characters we use to call up a set of procedures, code-wise all these cmds are just merely a public function that get called by the command processor, so we are technically still doing what Y_Less said.
Both ways are the "right way" to call commands, he just gave a bad syntax for the CallRemoteFunction, as empty strings crash server. |
Thank you for your reply. I have decided to use your 22 flags defines you posted earlier in this topic.
But I need help with adjusting my conditional statements in OnPlayerCommandReceived(), because in their present state permissions are still not working properly. Could you provinde an example? Thanks! |
If you don't know much about bit manipulation I suggest opening a thread about this in the Scripting Help section on this subject.
|
I'd rather ask here than make a whole new topic because I've looked into the matter now and got a little question:
Why use (flags & DEFINED_FLAG) ? Wouldn't (flags == DEFINED_FLAG) make more sense? I figured out that option 2 wouldn't work if you used multiple flags for one command. But as far as I'm concerned doesn't the & operation make a bitstring? Won't that bitstring be interpreted as an integer when using the && operator? Edit: I actually figured it out while typing this message, lol. Thanks a bunch! |