SA-MP Forums Archive
unknown command? - 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: unknown command? (/showthread.php?tid=341801)



unknown command? - TheDiscussionCafe - 12.05.2012

i have job script from other peoples and when i type /takejob ingame, it will start job but it will also say "unknown command" rite after. i never happen in 0.3d only 0.3e. how to fix? this is my code:

pawn Код:
YCMD:takejob(playerid,params[],help)
{
#pragma unused help
#pragma unused params
new id = GetJobID(playerid);
if(id == -1) return SCM(playerid,COLOR_RED,"ERROR: You Are Not Near Any Job Opportunities.");
if(P_Data[playerid][pJob] != 0) return SCM(playerid,COLOR_RED,"ERROR: You Already Have A Job!");
SendFormatMSG(playerid,-1,"You Have Joined The Job {E0941B}%s. Type /startjob To Start The Job.",Job[id][Name]);
P_Data[playerid][pJob] = id;
return 1;
}



Re: unknown command? - Jonny5 - 12.05.2012

i had to remove the OnPlayerCommandText callback from my gamemode to stop this.

try that and see.


Re: unknown command? - TheDiscussionCafe - 12.05.2012

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
i had to remove the OnPlayerCommandText callback from my gamemode to stop this.

try that and see.
i dont have that anywhere in gamemode or filterscript. no Onplayercommandtext.


Re: unknown command? - [LvZ]Free - 12.05.2012

Look for no closed brackets "{}"


Re: unknown command? - TheDiscussionCafe - 12.05.2012

Quote:
Originally Posted by [LvZ]Free
Посмотреть сообщение
Look for no closed brackets "{}"
no all brackets are gooddd. idk why? pls help?


Re: unknown command? - JaKe Elite - 12.05.2012

do you have OnPlayerCommandPerformed or OnPlayerCommandRecieved?
if you have post here maybe i help?


Re: unknown command? - TheDiscussionCafe - 12.05.2012

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid,COLOR_WHITE, "Unknown command!");
    return 1;
}



Re: unknown command? - JaKe Elite - 12.05.2012

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid,COLOR_WHITE, "Unknown command!");
    return 1;
}



Re: unknown command? - TheDiscussionCafe - 12.05.2012

Quote:
Originally Posted by Romel
Посмотреть сообщение
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid,COLOR_WHITE, "Unknown command!");
    return 1;
}
no the same thing happen


Re: unknown command? - [LvZ]Free - 12.05.2012

What's the point of YCMD:takejob(playerid,params[],help) ... help here?
And the point of #pragma unused help this ? I mean u don't use "help" anywhere...
sorry for my stupid question

I ask for the brackets beacuz if you don't close it, u will return something diffrent from the real
.. Try to remove this if(!success) return SendClientMessage(playerid,COLOR_WHITE, "Unknown command!"); ...