SA-MP Forums Archive
OnPlayerCommandText - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerCommandText (/showthread.php?tid=235181)



OnPlayerCommandText - G*Mafia - 05.03.2011

Hello, I wanna change the SERVER: UNKNOWN COMMAND to my own, here is my OnPlayerCommandText line

public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp("/drylake", cmdtext, true, 10) == 0)
{
SetPlayerPos (playerid, -31,1464,15);
SetPlayerInterior (playerid, 0);
SendClientMessage(playerid,0x0080FFFF,"Welcome to Dry Lake, stupid noob!");
return 1;

}


Re: OnPlayerCommandText - iMonk3y - 05.03.2011

At the very botton of OnPlayerCommandText callback, replace return 0; with:
pawn Code:
return SendClientMessage(playerid, COLOR, "Your message");



Re: OnPlayerCommandText - Antonio [G-RP] - 05.03.2011

Quote:
Originally Posted by iMonk3y
View Post
At the very botton of OnPlayerCommandText callback, replace return 0; with:
pawn Code:
return SendClientMessage(playerid, COLOR, "Your message");
Does that work when using zcmd too?


Re: OnPlayerCommandText - iMonk3y - 05.03.2011

Yes, it works with zcmd too.. haven't you read the zcmd topic? :P
https://sampforum.blast.hk/showthread.php?tid=91354

pawn Code:
OnPlayerCommandPerformed(playerid, cmdtext[], success)
Here if you do return 0; the player will see standard "Unknown command" message.


Re: OnPlayerCommandText - G*Mafia - 05.03.2011

hey man where shall i put this

return SendClientMessage(playerid, COLOR, "Your message");

?
this is onplayercommandtext

public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp("/drylake", cmdtext, true, 10) == 0)
{
SetPlayerPos (playerid, -31,1464,15);
SetPlayerInterior (playerid, 0);
SendClientMessage(playerid,0x0080FFFF,"Welcome to Dry Lake, stupid noob!");
return 1;

}



can u put it for me


Re: OnPlayerCommandText - xir - 05.03.2011

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp("/drylake", cmdtext, true, 10) == 0)
   {
       SetPlayerPos (playerid, -31,1464,15);
       SetPlayerInterior (playerid, 0);
       SendClientMessage(playerid,0x0080FFFF,"Welcome to Dry Lake, stupid noob!");
       return 1;
   }
   return SendClientMessage(playerid, YOUR_COLOR, "Unknown command."); // edit it if you want
}
Try this.

And a nice thing to say to your players :P


Re: OnPlayerCommandText - G*Mafia - 05.03.2011

haha


Re: OnPlayerCommandText - ilikenuts - 05.03.2011

hi,
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp("/drylake", cmdtext, true, 10) == 0)
   {
       SetPlayerPos (playerid, -31,1464,15);
       SetPlayerInterior (playerid, 0);
       SendClientMessage(playerid,0x0080FFFF,"Welcome to Dry Lake, stupid noob!");
       return 1;
   }
   return SendClientMessage(playerid, COLOR, "Bad Command. Type /commands for available commands.");
how to make Pawncode


Re: OnPlayerCommandText - xir - 05.03.2011

ilikenuts put [ pawn ] [ /pawn ]