28.06.2016, 02:04
Worked after converting to easy-mysql
Yeah, but you didn't fix anything. You just went and did something you didn't need to do.
Though, if you were using y_ini for saving profiles and such, it's a great trade. But what will you do if you still want to use other YSI libraries? Do you have a good replacement for ALL of them? |
Yeah, but you didn't fix anything. You just went and did something you didn't need to do.
Though, if you were using y_ini for saving profiles and such, it's a great trade. But what will you do if you still want to use other YSI libraries? Do you have a good replacement for ALL of them? |
Pawn.CMD is not compatible with YSI because YSI changes public's ids at runtime.
|
[debug] Run time error 20: "Invalid index parameter (bad entry point)"
native PC_EmulateCommand(playerid, const cmdtext[], extra);
// Example Defines
#define CMD_EX_HELP 1
#define CMD_EX_INFO 2
CMD:something(playerid, params[], extra) {
if(extra == CMD_EX_HELP)
return SendClientMessage(playerid, -1, "Command Syntax: /something <param 1> <param 2>");
if(extra == CMD_EX_INFO)
return SendClientMessage(playerid, -1, "This is a randomly named command.");
// Else, run command normally.
return 1;
}
CMD:cmdhelp(playerid, params[], extra) {
if(extra == CMD_EX_HELP)
return SendClientMessage(playerid, -1, "Command Syntax: /cmdhelp <command name>");
if(extra == CMD_EX_INFO)
return SendClientMessage(playerid, -1, "This command returns help for a specified command.");
if(!PC_CommandExists(params))
return SendClientMessage(playerid, -1, "That command doesn't exist.");
PC_EmulateCommand(playerid, params, CMD_EX_HELP);
}
CMD:cmdinfo(playerid, params[], extra) {
if(extra == CMD_EX_HELP)
return SendClientMessage(playerid, -1, "Command Syntax: /cmdinfo <command name>");
if(extra == CMD_EX_INFO)
return SendClientMessage(playerid, -1, "This command returns information on a specified command.");
if(!PC_CommandExists(params))
return SendClientMessage(playerid, -1, "That command doesn't exist.");
PC_EmulateCommand(playerid, params, CMD_EX_INFO);
}
Ok, so I know I said before that I would transit to this plugin if you added the features I mentioned before... And you DID add them all... But now I have one more request...
A 'help' parameter on the commands, like in y_commands. You could simply add the help parameter to the command syntax or make it optional if possible. You would then need to add a help parameter to PC_EmulateCommand. Though, I don't like the idea of it being called 'help'. You could call it 'extra'. That way it would make more sense as an integer and we could call the command with extra details. For example: pawn Код:
|
#define CMD_DEFAULT (0b10000000000)
#define CMD_TEAM_1 (0b01000000000)
#define CMD_TEAM_2 (0b00100000000)
#define CMD_ADMIN_1 (0b00010000000)
#define CMD_ADMIN_2 (0b00011000000)
#define CMD_ADMIN_3 (0b00011100000)
#define CMD_ADMIN_4 (0b00011110000)
#define CMD_ADMIN_5 (0b00011111000)
#define CMD_VIP_1 (0b00000000100)
#define CMD_VIP_2 (0b00000000110)
#define CMD_VIP_3 (0b00000000111)
That's not how bitflags work. Some of those numbers aren't even valid 32-bit integers. I guess you wanted to write them in binary form instead of hexadecimal.
|
// Everybody
#define CMD_DEFAULT (0b10000000000000000000000000000000)
// Teams
#define CMD_TEAM_1 (0b01000000000000000000000000000000)
#define CMD_TEAM_2 (0b00100000000000000000000000000000)
// Admins
#define CMD_ADMIN_1 (0b00010000000000000000000000000000)
#define CMD_ADMIN_2 (0b00011000000000000000000000000000)
#define CMD_ADMIN_3 (0b00011100000000000000000000000000)
#define CMD_ADMIN_4 (0b00011110000000000000000000000000)
#define CMD_ADMIN_5 (0b00011111000000000000000000000000)
// VIP
#define CMD_VIP_1 (0b00000000100000000000000000000000)
#define CMD_VIP_2 (0b00000000110000000000000000000000)
#define CMD_VIP_3 (0b00000000111000000000000000000000)
// Jobs
#define CMD_MINERS (0b00000000000100000000000000000000)
#define CMD_CASHIER (0b00000000000010000000000000000000)
#define CMD_FISHER (0b00000000000001000000000000000000)
#define CMD_COP_1 (0b00000000000000100000000000000000)
#define CMD_COP_2 (0b00000000000000110000000000000000)
#define CMD_COP_3 (0b00000000000000111000000000000000)
// Classes
#define CMD_ARMY (0b0000000000000000110000000000000000)
#define CMD_MARINE (0b0000000000000000100000000000000000)
#define CMD_NAVY (0b0000000000000000010000000000000000)
#define CMD_GENERAL (0b0000000000000000111000000000000000)
// Almighty
#define CMD_OWNER (0b1111111111111111111111111111111111)