SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 12/09/2017, 10:25 AM   #411
Djole1337
Gangsta
 
Join Date: Apr 2012
Posts: 906
Reputation: 303
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by must006 View Post
Thanks @Djole1337

I also discovered:
Code:
PC_EmulateCommand(playerid, "/faction");
pc_cmd_setinterior(playerid, "0 5");
callcmd::setinterior(playerid, "0 5");
I have a problem now:

Code:
CMD:oldcar(playerid)
{
	if(!IsPlayerAdmin(playerid)) return 0;
//	...
	return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success) return SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command. (test)");
	return 1;
}
When using zcmd, if return is 0, "SERVER: Unknown command. (test)" message is displayed automatically. How can I do this with Pawn.CMD? Except that:

Code:
CMD:oldcar(playerid)
{
	if(!IsPlayerAdmin(playerid)) return SendErrorMessage(playerid);
//	...
	return 1;
}

stock SendErrorMessage(playerid)
{
	SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command. (test)");
	return 0;
}
Well he provided this callback, its similar to zcmd's one except the params are different. You should check https://github.com/urShadow/Pawn.CMD he provied quite a few examples.
PHP Code:
public OnPlayerCommandPerformed(playeridcmd[], params[], resultflags)
{
    
// if(result == -1)
    // so you should do something like
    
if(result == -|| result == 0)
    {
        
SendClientMessage(playerid0xFFFFFFFF"SERVER: Unknown command.");
        return 
0;
    }

    return 
1;

__________________
YouKnowWho
Djole1337 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [I-ZCMD]Improved ZCMD - Fastest Command Processor Yashas Includes 99 23/07/2017 04:23 PM
[Tutorial] PAWN Pre-Processor (Updated 22/04/13) Misiur Tutorials 6 10/07/2016 02:33 PM
[Include] y_commands - Most flexible and fastest command processor, now on the YSI wiki corne Includes 19 03/12/2015 01:41 AM
[Tutorial] PAWN Pre-Processor - Pre-processor alternatives - Part 5/7 Misiur Tutorials 0 14/04/2015 09:13 PM


All times are GMT. The time now is 06:21 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.