SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 13/08/2012, 10:23 AM   #1
nGen.SoNNy
Gangsta
 
nGen.SoNNy's Avatar
 
Join Date: Sep 2009
Location: Vaslui, Romania
Posts: 922
Reputation: 56
Question UNKNOWN COMMAND - WORKED BUT ERROR

Hi all! If i type this command... i will buy the house but i will get the msg: unknown command... so.. (succes = 0 ) .. Can you help me?


Code:
if( success == 0)Info( playerid, "~r~~h~Unknown Command!~n~~n~~w~These commands may help you~n~~g~~h~/help /cmds /teles /rules /credits",6000 );


Code:
CMD:exithouse(playerid, params[])
{
	new pos = IsPlayerInRangeOfHouseEx(playerid);
	if(IsPlayerInRangeOfHouseEx(playerid))
    {
    	SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerPos(playerid, HouseEnterX[playerid], HouseEnterY[playerid], HouseEnterZ[playerid]);
        return CallLocalFunction("OnPlayerExitHouse", "dd", playerid, pos);
  	}
  	else SendError(playerid, "You have to be in someone House!");
  	return ( 1 );
}
__________________
If i've helped you, please click
nGen.SoNNy is offline   Reply With Quote
Old 13/08/2012, 10:51 AM   #2
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,084
Reputation: 346
Default Re: UNKNOWN COMMAND - WORKED BUT ERROR

Edit: Fail

no, not success == 0
it must be like this

Code:
if(!sucess) return //do whatever you want here

put it here

Code:
public OnPlayerCommandPerformed(playerid, cmdtext[], sucess)
{
    return 1;
}
__________________
Grace is Love.


Click this to launch your SA-MP Client Browser & Save/Connect to the GamerX server.
I am no longer playing Roleplay servers, i am returning to my old - Stunt~DM~Race~Event type server, Currently at GamerX.
JaKe Elite is offline   Reply With Quote
Old 13/08/2012, 10:58 AM   #3
nGen.SoNNy
Gangsta
 
nGen.SoNNy's Avatar
 
Join Date: Sep 2009
Location: Vaslui, Romania
Posts: 922
Reputation: 56
Default Re: UNKNOWN COMMAND - WORKED BUT ERROR

my problem is on that command not my command check i'm using that function on OnPlayerCommandPerformed
And i found the problem... i have to remove that return from
Code:
return CallLocalFunction("OnPlayerExitHouse", "dd", playerid, pos);

I'm a little bit angry and i lost my mind on this easy thing..,
__________________
If i've helped you, please click
nGen.SoNNy is offline   Reply With Quote
Old 13/08/2012, 11:19 AM   #4
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,084
Reputation: 346
Default Re: UNKNOWN COMMAND - WORKED BUT ERROR

Remove the return from the CallRemoteFunction
then under the CallRemoreFunction put return 1;
__________________
Grace is Love.


Click this to launch your SA-MP Client Browser & Save/Connect to the GamerX server.
I am no longer playing Roleplay servers, i am returning to my old - Stunt~DM~Race~Event type server, Currently at GamerX.
JaKe Elite is offline   Reply With Quote
Old 13/08/2012, 11:46 AM   #5
nGen.SoNNy
Gangsta
 
nGen.SoNNy's Avatar
 
Join Date: Sep 2009
Location: Vaslui, Romania
Posts: 922
Reputation: 56
Default Re: UNKNOWN COMMAND - WORKED BUT ERROR

I said: "And i found the problem... i have to remove that return" ....
__________________
If i've helped you, please click
nGen.SoNNy 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
SERVER:UNKNOWN COMMAND error ttloko2 Scripting Help 19 26/01/2012 11:56 PM
server:unknown Error When There is an Command. HayZatic Help Archive 2 07/07/2011 12:13 AM
[ERROR] HELP ME! UNKNOWN COMMAND... Jack321 Help Archive 4 30/01/2010 11:25 PM
[HELP] Unknown Command Error kevin974 Help Archive 20 29/08/2009 05:05 PM
Error: Unknown command Antonio [G-RP] Help Archive 3 12/08/2009 05:33 AM


All times are GMT. The time now is 06:58 PM.


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