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)
+--- Thread: OnPlayerCommandText (/showthread.php?tid=431729)



OnPlayerCommandText - nor15 - 19.04.2013

I use this
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    
//dcmd//
    //Civilian commands//
    
dcmd(gcmds,5,cmdtext); //General Commands
    
dcmd(cmds,4,cmdtext);
    
dcmd(rules,5,cmdtext);
    }
    return 
SendClientMessage(playerid,COLOR_RED,"This is a wrong command , Read /cmds and /gcmds");

But i got those errors
PHP код:
C:\Users\user\Desktop\SFCRRPGv1.1\Los Santos TDM\gamemodes\new.pwn(249) : error 017undefined symbol "dcmd_gcmds"
C:\Users\user\Desktop\SFCRRPGv1.1\Los Santos TDM\gamemodes\new.pwn(251) : error 017undefined symbol "dcmd_rules"
C:\Users\user\Desktop\SFCRRPGv1.1\Los Santos TDM\gamemodes\new.pwn(252) : warning 209: function "OnPlayerCommandText" should return a value
C
:\Users\user\Desktop\SFCRRPGv1.1\Los Santos TDM\gamemodes\new.pwn(254) : error 010invalid function or declaration
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
3 Errors




Re: OnPlayerCommandText - DaRk_RaiN - 19.04.2013

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

    //dcmd//
    //Civilian commands//
    dcmd(gcmds,5,cmdtext); //General Commands
    dcmd(cmds,4,cmdtext);
    dcmd(rules,5,cmdtext);

    return SendClientMessage(playerid,COLOR_RED,"This is a wrong command , Read /cmds and /gcmds");
}



Re: OnPlayerCommandText - alon4210 - 19.04.2013

You should add this here:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])



Re: OnPlayerCommandText - nor15 - 19.04.2013

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

    //dcmd//
    //Civilian commands//
    dcmd(gcmds,5,cmdtext); //General Commands
    dcmd(cmds,4,cmdtext);
    dcmd(rules,5,cmdtext);

    return SendClientMessage(playerid,COLOR_RED,"This is a wrong command , Read /cmds and /gcmds");
}
Thanks it works
@alon4210 .. No Comment