SA-MP Forums Archive
My commands arnt work! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: My commands arnt work! (/showthread.php?tid=336888)



My commands arnt work! - Michael_Cuellar - 24.04.2012

This is what I got, it compiles and everything but when I test it out I get unknown command. It did the same thing with the /kill command. please help!

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help()", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0xFFFF00AA, "(INFO) Welcome to my Server's HELP command!");
SendClientMessage(playerid, 0xFFFF00AA, "(INFO) Hope you enjoy the tutorial!");
return 1;
}
return 0;
}


Re: My commands arnt work! - iRage - 24.04.2012

PHP код:

public OnPlayerCommandText(playeridcmdtext[])
{
     if (!
strcmp("/help"cmdtexttrue5))
     {
          
SendClientMessage(playerid0xFFFF00AA"(INFO) Welcome to my Server's HELP command!");
          
SendClientMessage(playerid0xFFFF00AA"(INFO) Hope you enjoy the tutorial!");
          return 
1;
     }
     return 
0;




Re: My commands arnt work! - Michael_Cuellar - 24.04.2012

that did nothing /;


Re: My commands arnt work! - nmader - 24.04.2012

Try this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if (!strcmp("/help", cmdtext, true, 5))
     {
          SendClientMessage(playerid, 0xFFFF00AA, "(INFO) Welcome to my Server's HELP command!");
          SendClientMessage(playerid, 0xFFFF00AA, "(INFO) Hope you enjoy the tutorial!");  
     }
     return 1;
}
return 0;



Re: My commands arnt work! - Michael_Cuellar - 24.04.2012

Actually i take that back /help doesnt work but when i type /whatever it pops up


Re: My commands arnt work! - nmader - 24.04.2012

Still, have you tried my editation to the script?


Re: My commands arnt work! - RollTi - 24.04.2012

Never tired to try this?

pawn Код:
if(!strcmp("/help", cmdtext, true))



Re: My commands arnt work! - Michael_Cuellar - 24.04.2012

RollTI you are my hero


Re: My commands arnt work! - RollTi - 24.04.2012

Quote:
Originally Posted by Michael_Cuellar
Посмотреть сообщение
RollTI you are my hero
don't know that the code i give will work actually i didn't try and test the code i just script it in new.pwn then post the code here

RollTi you are my hero

hehehehehe thanks