- Fail Commands.
#1

How creat system if player do some fail command its say him
Something like this "Error: to see server cmd do (/help) Or (/helpme)."
Reply
#2

Change your 'OnPlayerCommandText' callback:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        //Change the return
    return SendClientMessage(playerid, -1, "That command does not exist. Use /help or /commands.");
}
Reply
#3

Код:
public OnPlayerCommandText(playerid, cmdtext[])
    {
    return SendClientMessage(playerid, -1, "That command does not exist. Use /help or /commands.");
	return 0;
}
Код HTML:
I:\NpTDM[0.3e]\filterscripts\dude.pwn(95) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
How to fix it??!!
Reply
#4

remove
pawn Код:
return 0;
since it becomes useless after you return; your message.
Reply
#5

Код HTML:
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(330) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(340) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(342) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(350) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(352) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(354) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(356) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(358) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(360) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(362) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(364) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(373) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(375) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(387) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(389) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(393) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(395) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(399) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(401) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(404) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(406) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(409) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(411) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(417) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(419) : error 010: invalid function or declaration
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(424) : error 010: invalid function or declaration

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


26 Errors.
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    //Commmands
    return SendClientMessage(playerid, -1, "That command does not exist. Use /help or /commands.");
}
Don't lose the last bracket
Reply
#7

Well try this

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(!success) SendClientMessage(playerid, -1, "That command does not exist. Use /help or /commands..");
    return 1;
}
Reply
#8

Код:
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(347) : error 029: invalid expression, assumed zero
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(347) : error 017: undefined symbol "OnPlayerCommandPerformed"
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(349) : error 017: undefined symbol "success"
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(352) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
]

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    public OnPlayerCommandPerformed(playerid, cmdtext[], success)
	{
	if(!success) SendClientMessage(playerid, -1, "That command does not exist. Use /help or /commands..");
    return 1;
	}
Reply
#9

You must use the ZCMD (Click Here)
And below there is how the code must looks like:
pawn Код:
#include <a_samp>
#include <zcmd>

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success == 0)
SendClientMessage(playerid, 0xFF0000FF, "That command does not exist. Use /help or /commands..");
return 1;
}
Reply
#10

Код:
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(404) : error 029: invalid expression, assumed zero
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(404) : error 017: undefined symbol "OnPlayerCommandPerformed"
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(406) : error 017: undefined symbol "success"
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(409) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)