SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 19/06/2018, 02:31 PM   #101
kovac
Banned
 
Join Date: Mar 2018
Posts: 182
Reputation: 14
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Quote:
Originally Posted by Verc View Post
Check previous page
What exactly? That include fix didn't change anything to me.
kovac is offline   Reply With Quote
Old 19/06/2018, 02:48 PM   #102
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 867
Reputation: 295
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Quote:
Originally Posted by kovac View Post
Commands appear to doesn't exist now. command /slap became /pm..
what am I doing wrong?
/slap becoming /pm? Can you elaborate on that?

Can you show the code?
Yashas is offline   Reply With Quote
Old 19/06/2018, 03:37 PM   #103
kovac
Banned
 
Join Date: Mar 2018
Posts: 182
Reputation: 14
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Quote:
Originally Posted by Yashas View Post
/slap becoming /pm? Can you elaborate on that?

Can you show the code?
Nothing much to explain. I was using zcmd before and it was normally working.
I guess command IDs are mixing up or something.

Here's slap command. I haven't checked other commands, but I doubt it happens with slap only.
Most of the other commands return error message that they don't exist.

PHP Code:
CMD:slap(cmdidplayeridparams[])
{
    if(
UserStats[playerid][AdminLevel] >= || UserStats[playerid][Helper] == 1)
    {
        new 
targetidamount;
        if(
sscanf(params"uI(5)"targetidamount)) return SCM(playeridCOLOR_RED"USAGE: /slap [player id] [amount(optional)]");
        if(!
IsPlayerConnected(targetid)) return SCM(playeridCOLOR_REDNOPLAYER);
        if(!
LoggedIn[targetid]) return SCM(playeridCOLOR_REDNOTLOGGEDIN);
        if(
amount 100) return SCM(playeridCOLOR_RED"[ERROR]: Value cannot be greater than 100!");
        if(
UserStats[playerid][AdminLevel] < UserStats[targetid][AdminLevel]) return SCM(playeridCOLOR_REDNOLEVEL);
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(targetidxyz);
        
SetPlayerPos(targetidxyamount);
        
PlayerPlaySound(playerid11900.00.00.0);
        
PlayerPlaySound(targetid11900.00.00.0);
        new 
adminmsg[128];
        
format(adminmsgsizeof(adminmsg), "You have slapped %s(%i)."GetName(targetid), targetid);
        
SCM(playeridCOLOR_REDadminmsg);
    }
    else
    {
        
SCM(playeridCOLOR_RED"[ERROR]: Admin level 1+ or helper command.");
    }
    return 
1;

And here is PM command

PHP Code:
CMD:pm(cmdidplayeridparams[])
{
    if(
Muted[playerid]-gettime() > 0)
    {
        new 
string[128];
        
format(stringsizeof(string), "[ERROR]: You are muted!. Time left: %d seconds."Muted[playerid]-gettime());
        
SCM(playeridCOLOR_REDstring);
        return 
1;
    }
    new 
str[128],id;
    if(
sscanf(params"us[128]"idparams)) return SCM(playeridCOLOR_RED"USAGE: /pm [id] [message]");
    if(!
IsPlayerConnected(id)) return SCM(playeridCOLOR_REDNOPLAYER);
    if(
id == INVALID_PLAYER_ID) return SCM(playeridCOLOR_REDNOTLOGGEDIN);
    if(
playerid == id) return SCM(playeridCOLOR_RED"[ERROR]: You cannot send a message to yourself.");
    
format(strsizeof(str), "[PM]{FFFFFF} To %s(%d): %s"GetName(id), idparams);
    
SCM(playeridCOLOR_GOLDstr);
    
format(strsizeof(str), "[PM]{FFFFFF} From %s(%d): %s"GetName(playerid), playeridparams);
    
SCM(idCOLOR_GOLDstr);
    
PlayerPlaySound(playerid1150000);
    return 
1;

When I do /slap without params, I get USAGE: /pm [id] [message]
kovac is offline   Reply With Quote
Old 19/06/2018, 04:11 PM   #104
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 867
Reputation: 295
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

What happens when you provide params?

You can make an issue: https://github.com/YashasSamaga/SmartCMD
Yashas is offline   Reply With Quote
Old 19/06/2018, 04:31 PM   #105
m4karow
Big Clucker
 
Join Date: Oct 2015
Posts: 137
Reputation: 13
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

When will this cmd processor support the NON ASCII characters?
m4karow is offline   Reply With Quote
Old 09/07/2018, 12:35 PM   #106
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 867
Reputation: 295
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

The series of state changes can be replaced with if else for better performance but the use case looks interesting.

Code:
CMD:menu(cmdid, playerid, params[]) {
	state cmdMode:help; /* by default, fallback to help mode */
 	if(!isnull(params)) { /* set valid modes, otherwise allow it to fallback to help mode */
 	        state (!strcmp(params, "vehicles")) cmdMode:vehicles;
    	        state (!strcmp(params, "weapons")) cmdMode:weapons;
    	        state (!strcmp(params, "skins")) cmdMode:skins;
 	}
        return cmd_menu(cmdid, playerid, params);
}

CMD:menu[vehicles](cmdid, playerid, params[]) {
	printf("Show vehicles menu");
	return CMD_SUCCESS;
}

CMD:menu[weapons](cmdid, playerid, params[]) {
	printf("Show weapons menu");
	return CMD_SUCCESS;
}

CMD:menu[skins](cmdid, playerid, params[]) {
	printf("Show skins menu");
	return CMD_SUCCESS;
}

CMD:menu[help](cmdid, playerid, params[]) {
	printf("Usage: /menu [vehicles,weapons,skins]");
	return CMD_SUCCESS;
}
Is there any one who uses command states features and wants to object to its removal?

Last edited by Yashas; 09/07/2018 at 01:48 PM.
Yashas is offline   Reply With Quote
Old 09/07/2018, 02:11 PM   #107
Verc
Big Clucker
 
Verc's Avatar
 
Join Date: Apr 2018
Location: 🇯🇵
Posts: 169
Reputation: 29
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

I never knew there is such feature..
but, I gotta say this include is amazing especially the use of flags,I've been using it for years.
Verc is online now   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] eXtended INI Processor - Fast & Feature Rich INI Processor Yashas Includes 28 01/09/2015 07:45 PM
[Include] r_commands - Clear and fast command processor! Swimor Includes 33 04/01/2013 03:30 PM
fast command processor [mad]MLK Help Archive 1 22/08/2009 01:32 AM


All times are GMT. The time now is 01:27 AM.


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