14.01.2012, 12:06
Ok so I got a main problem, I'm using these simple commands, /g is my giobal chat and /me is the RP-action command. The problem is if you I type /me and just space it still works other than returning the message like it does when you just type /me, it also works if you use /meeeeeeeeeeeeee, and same with /g, except it doesn't work with /gggggggggggggg but it does work if you type /g and space, I want it to be avoided, - I'm a new scripter so I require your help, plus I tried copying these commands from advanced gamemodes but I fail with errors and warnings, so any of your help will be appreciated, these are the cmds:
/g
if(!strcmp(cmdtext,"/g ",true,2))
{
new find = strfind(cmdtext," ",true);
if(find == -1 || find >= 30) return SendClientMessage(playerid, COLOR_RED, "Right Usage: \"/g\" [text]");
new string[256]; //bite me
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"((Global: %s: %s ))", string, cmdtext[find+1]);
return SendClientMessageToAll(COLOR_SEAGREEN, string);
}
/me
if(!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
ProxDetector(170.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 0;
}
/g
if(!strcmp(cmdtext,"/g ",true,2))
{
new find = strfind(cmdtext," ",true);
if(find == -1 || find >= 30) return SendClientMessage(playerid, COLOR_RED, "Right Usage: \"/g\" [text]");
new string[256]; //bite me
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"((Global: %s: %s ))", string, cmdtext[find+1]);
return SendClientMessageToAll(COLOR_SEAGREEN, string);
}
/me
if(!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
ProxDetector(170.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 0;
}