How can i?
#1

hey i wanted to ask how can i make a cmd of when a player types a wrong cmd instead of saying ''Sever unkown command'' it should say unkown command type /cmds to see list of cmds.
Reply
#2

return SendClientMessage(playerid,COLOR,"This type your message !");
put under return 0; on player command text

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return SendClientMessage(playerid,COLOR,"This type your message !");
}
Reply
#3

What command processor do you use? ZCMD? DCMD? SA:MP default? Each one has a different way.
Reply
#4

I mostly use zcmd,its easy for me
Reply
#5

Here for ZCMD
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)  
{  
     if(!success) return SendClientMessage(playerid,RED,"This Command does not exist!");  
     return true;  
}
Reply
#6

Quote:
Originally Posted by lanix
Посмотреть сообщение
Here for ZCMD
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)  
{  
     if(!success) return SendClientMessage(playerid,RED,''Sever unkown command'");  
     return true;  
}
Edited
Reply
#7

From my Balkan server,lol
Reply
#8

well RIP For me there is a error -_-
Код:
C:\Users\Waqar\Desktop\z\The Ultimate Freeroam\gamemodes\freeroam.pwn(747) : error 017: undefined symbol "RED"
C:\Users\Waqar\Desktop\z\The Ultimate Freeroam\gamemodes\freeroam.pwn(747) : error 017: undefined symbol "Sever"
C:\Users\Waqar\Desktop\z\The Ultimate Freeroam\gamemodes\freeroam.pwn(747) : error 017: undefined symbol "unkown"
C:\Users\Waqar\Desktop\z\The Ultimate Freeroam\gamemodes\freeroam.pwn(747) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
http://i.imgur.com/pNj5woM.png
Reply
#9

put
pawn Код:
#define RED 0xFF0000FF
with the other Defines on the top of your script

and

change from ' ' to "
Reply
#10

thanks andre it worked can someone tell me how this little code can do that i mean now whenever i type it wrongit will say that but how?
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)  
{  
     if(!success) return SendClientMessage(playerid,RED,''Sever unkown command'");  
     return true;  
}
thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)