SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/05/2019, 06:43 PM   #1
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 410
Reputation: 13
Default Changing the Unknown Command with ZCMD

Hey guys im trying to edit the thing when you type a wrong command it always say to u Unknown Command, so i want to edit it but idk why isnt work for me, im making a multilanguage server and i dont have errors but idk what to do, this si what i have:

PHP Code:
forward OnPlayerCommandPerformed(playeridcmdtext[], success);
public 
OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
success)SendMessage(playerid,COLOR_WHITE,"{FF0000}ADVERTENCIA: {FFFFFF}Este comando no existe. Usa {0092FF}/ayuda {FFFFFF}para ver la lista de comandos o {0092FF}(/n)ovato + [ Tu pregunta ]{FFFFFF}para preguntas relacionadas con el servidor.",
                                           
"{FF0000}WARNING: {FFFFFF}That command doesn't exist. Use {0092FF}/help {FFFFFF}to see a list of commands or {0092FF}(/n)ewbie + [ Your question ]{FFFFFF}for server related questions.");
    return 
1;

any idea how to solve it?
Jaua10 is offline   Reply With Quote
Old 26/05/2019, 06:49 PM   #2
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 144
Reputation: 3
Default Re: Changing the Unknown Command with ZCMD

PHP Code:
forward OnPlayerCommandPerformed(playeridcmdtext[], success);
public 
OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
success) return SendMessage(playerid,COLOR_WHITE,"{FF0000}ADVERTENCIA: {FFFFFF}Este comando no existe. Usa {0092FF}/ayuda {FFFFFF}para ver la lista de comandos o {0092FF}(/n)ovato + [ Tu pregunta ]{FFFFFF}para preguntas relacionadas con el servidor.",
                                           
"{FF0000}WARNING: {FFFFFF}That command doesn't exist. Use {0092FF}/help {FFFFFF}to see a list of commands or {0092FF}(/n)ewbie + [ Your question ]{FFFFFF}for server related questions.");
    return 
1;

Added "return" before "SendMessage". Try if it works
NoteND is offline   Reply With Quote
Old 26/05/2019, 06:52 PM   #3
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 410
Reputation: 13
Default Re: Changing the Unknown Command with ZCMD

Still not working...i dont understand why
Jaua10 is offline   Reply With Quote
Old 26/05/2019, 07:00 PM   #4
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 144
Reputation: 3
Default Re: Changing the Unknown Command with ZCMD

Then try

PHP Code:
if(!success)
{
       
SendMessage(playerid,COLOR_WHITE,"{FF0000}ADVERTENCIA: {FFFFFF}Este comando no existe. Usa {0092FF}/ayuda {FFFFFF}para ver la lista de comandos o {0092FF}(/n)ovato + [ Tu pregunta ]{FFFFFF}para preguntas relacionadas con el servidor.",
                                           
"{FF0000}WARNING: {FFFFFF}That command doesn't exist. Use {0092FF}/help {FFFFFF}to see a list of commands or {0092FF}(/n)ewbie + [ Your question ]{FFFFFF}for server related questions.");
       return 
0;
}

return 
1
NoteND is offline   Reply With Quote
Old 26/05/2019, 07:05 PM   #5
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 410
Reputation: 13
Default Re: Changing the Unknown Command with ZCMD

Quote:
Originally Posted by NoteND View Post
Then try

PHP Code:
if(!success)
{
       
SendMessage(playerid,COLOR_WHITE,"{FF0000}ADVERTENCIA: {FFFFFF}Este comando no existe. Usa {0092FF}/ayuda {FFFFFF}para ver la lista de comandos o {0092FF}(/n)ovato + [ Tu pregunta ]{FFFFFF}para preguntas relacionadas con el servidor.",
                                           
"{FF0000}WARNING: {FFFFFF}That command doesn't exist. Use {0092FF}/help {FFFFFF}to see a list of commands or {0092FF}(/n)ewbie + [ Your question ]{FFFFFF}for server related questions.");
       return 
0;
}

return 
1
now show to me unknown command
Jaua10 is offline   Reply With Quote
Old 27/05/2019, 01:07 AM   #6
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 410
Reputation: 13
Default Re: Changing the Unknown Command with ZCMD

Why this dont work if o dont hace errores or wsrnings?
Jaua10 is offline   Reply With Quote
Old 27/05/2019, 01:18 AM   #7
TheToretto
Gangsta
 
TheToretto's Avatar
 
Join Date: Jul 2015
Posts: 593
Reputation: 66
Default Re: Changing the Unknown Command with ZCMD

Why are you re-defining it using forward? It all comes with the include, remove that line and try again
__________________






Toretto#9902

Rest in peace grandpa, 03 November 2018
TheToretto is offline   Reply With Quote
Old 27/05/2019, 01:35 AM   #8
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 410
Reputation: 13
Default Re: Changing the Unknown Command with ZCMD

Quote:
Originally Posted by TheToretto View Post
Why are you re-defining it using forward? It all comes with the include, remove that line and try again
Cuz i try without that forward and still showing the a. No error ir warning but show me nothing IG
Jaua10 is offline   Reply With Quote
Old 27/05/2019, 05:26 AM   #9
Koreadars
Big Clucker
 
Join Date: Mar 2019
Location: Czech Republic, Prdelákov.
Posts: 120
Reputation: 6
Default Re: Changing the Unknown Command with ZCMD

Send two SendClientMessages instead of using SendMessage.
Koreadars is offline   Reply With Quote
Old 27/05/2019, 11:43 AM   #10
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 410
Reputation: 13
Default Re: Changing the Unknown Command with ZCMD

Quote:
Originally Posted by Koreadars View Post
Send two SendClientMessages instead of using SendMessage.
i think i cant cuz i am using two languages
Jaua10 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Unknown Command zrelly Scripting Help 2 29/09/2013 02:34 PM
zcmd, unknown command? niels44 Scripting Help 7 23/10/2012 04:04 PM
Executed ZCMD command returns SERVER: Unknown Command SexTourist Scripting Help 12 03/01/2012 03:38 PM
changing server unknown command help hadzx Help Archive 1 30/10/2010 04:36 PM


All times are GMT. The time now is 12:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.