Gamemode commands arent working >_< -
_Vortex - 02.11.2009
Hey, the commands that are coded on my gamemode aren't working, they're not doing anything at all. But, the ones that are on my admin filterscript work fine.
Here's the code to the gamemodes OnPlayerCommandText, maybe someone can figure out what's going on? (I'm sure it's some stupid mistake that I'm to dumb to find myself) :P
http://pastebin.com/f22b3afed
Re: Gamemode commands arent working >_< -
Kyosaur - 02.11.2009
It's probably because you are returning 1 on OnPlayerCommandText.
Re: Gamemode commands arent working >_< -
_Vortex - 02.11.2009
Tried returning 0 also, same thing.
Re: Gamemode commands arent working >_< -
Kyosaur - 02.11.2009
Quote:
Originally Posted by [B
Vortex ]
Tried returning 0 also, same thing.
|
to avoid confusion, i'll show you what i mean:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new tmp[256];
new Message[256];
new gMessage[256];
new pName[MAX_PLAYER_NAME+1];
new iName[MAX_PLAYER_NAME+1];
new idx;
if(!strcmp("/pm", cmdtext, true))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /pm (id) (message)");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"/pm :Invalid ID");
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%i): %s",iName,id,gMessage);
SendClientMessage(playerid,0xFFD720FF,Message);
format(Message,sizeof(Message),"** %s(%i): %s",pName,playerid,gMessage);
SendClientMessage(id,0xFFD720FF,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
return 1; //thats fine
}
dcmd(lv, 2, cmdtext);
dcmd(sf, 2, cmdtext);
dcmd(ls, 2, cmdtext);
return 1; //thats what im talking about
}
If you changed the one im talking about to 0, and it's still not working, post the commands please.
Edit: [color] fail xD.
Re: Gamemode commands arent working >_< -
_Vortex - 02.11.2009
Yes, I know what you meant. I returned the whole callback 0, i tried, same problem. And it's not the commands because even /pm won't work.
Re: Gamemode commands arent working >_< -
MadeMan - 02.11.2009
What do you return in your filterscript's OnPlayerCommandText ?
Re: Gamemode commands arent working >_< -
_Vortex - 02.11.2009
1
Re: Gamemode commands arent working >_< -
Kyosaur - 02.11.2009
Quote:
Originally Posted by [B
Vortex ]
1
|
there's your problem. If you return 1 under OnPlayerCommandText, it wont get passed to other scripts.
Re: Gamemode commands arent working >_< -
_Vortex - 02.11.2009
Quote:
Originally Posted by Kyosaur!!
Quote:
Originally Posted by [B
Vortex ]
1
|
there's your problem.
|
Lol thanks.
Re: Gamemode commands arent working >_< -
_Vortex - 02.11.2009
Quote:
Originally Posted by Kyosaur!!
Quote:
Originally Posted by [B
Vortex ]
1
|
there's your problem.
|
Lol thanks.