27.12.2010, 02:00
I have two commands, one is a chat command and the other is just a normal command (Not chat).
The chat command is /t
and the command is /top
When i type /t and my message, Example,
[TEAM-CHAT] PlayerName: test
it works but when i do the command /top this happens,
[TEAM-CHAT] PlayerName: op
It basically just thinks when i type /top the first T is refering to the chat command. and it does /t and it types out "op"
Can you please help me out! Thanks! The commands as usual:
The chat command is /t
and the command is /top
When i type /t and my message, Example,
[TEAM-CHAT] PlayerName: test
it works but when i do the command /top this happens,
[TEAM-CHAT] PlayerName: op
It basically just thinks when i type /top the first T is refering to the chat command. and it does /t and it types out "op"
Can you please help me out! Thanks! The commands as usual:
pawn Код:
if (strcmp("/t", cmdtext, true, 2) == 0)
{
new playername[24];
GetPlayerName(playerid, playername, 24);
if(strlen(cmdtext) <= 2)
{
SendClientMessage(playerid, COLOR_BLUE, "USAGE: /t (Text)");
return 1;
}
new output[255];
strmid(output,cmdtext,2,strlen(cmdtext));
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
format(string, sizeof(string), "[TEAM-CHAT] %s: %s", playername, output);
SendClientMessage(i, COLOR_BLUE, string);
}
}
return 1;
}
pawn Код:
// Some parts of command removed. but weren't important.
if (strcmp("/top", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, "You have placed it on the top.");
return 1;
}