SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/01/2018, 02:56 PM   #1
Longover
Big Clucker
 
Longover's Avatar
 
Join Date: Oct 2017
Location: Romania
Posts: 190
Reputation: 0
Question Server:Unknown command.

Hello! I'm have a problem...
When i'm type /mycars
i'm see a message in chat:
Code:
Server:Unknown command.
But my server have this command:
Code:
dcmd_mycars(playerid, params[])
{
	#pragma unused params
	new namec[MAX_PLAYER_NAME], string[MAX_STRING];
	GetPlayerName(playerid, namec, sizeof(namec));
	carsshow[playerid] = 0;
	if(AccountInfo[playerid][Vehicule] == 0) return SCM(playerid, ERROR, "Nu ai nici-un vehicul !");
	for(new i = buyablecars; i<sizeof(VehInfo); i++)
	{
		if(strcmp(VehInfo[i][Propietar], namec, true) == 0)
	    	{
	    	    if(carsshow[playerid] <= AccountInfo[playerid][Vehicule])
	        	{
			 		GetVehicleName(i);
			 		new value = VehInfo[i][Valoare]%2;
					new Neontxt[10], Statustxt[10];
					if(VehInfo[i][Neon] >= 1) { Neontxt = "Da"; }
					else if(VehInfo[i][Neon] == 0) { Neontxt = "Nu"; }
					if(VehInfo[i][Inchisa] == 0) { Statustxt = "Nu"; }
					else if(VehInfo[i][Inchisa] == 1) { Statustxt = "Da"; }
	        		format(string,sizeof(string), "ID: %d, Model: %s Valoare: %d, Neon: %s, Inchisa: %s, Kilometrii: %d", i, VehicleNames[GetVehicleModel(i)-400], value, Neontxt, Statustxt, VehInfo[i][Km]);
					SCM(playerid,COLOR_YELLOW,string); carsshow[playerid] += 1;
					format(string,sizeof(string), "Vehicule: %d | Sloturi pentru vehicule: %d", AccountInfo[playerid][Vehicule], AccountInfo[playerid][MaxVeh]);
					SCM(playerid,COLOR_YELLOW,string);
				}
			}
        carsshow[playerid] = 0;
		}
	return 1;
}
Why?
+1 for help!
Longover is offline   Reply With Quote
Old 07/01/2018, 03:51 PM   #2
pollo97
Big Clucker
 
pollo97's Avatar
 
Join Date: Sep 2011
Location: Italy
Posts: 83
Reputation: 4
Default Re: Server:Unknown command.

Probably it's cause from array out of bound error.
Try to install this plugin: https://github.com/Zeex/samp-plugin-crashdetect
After use the command and see if in the console show up some error.

Usually, when i have this kind of problem is for an array index negative or too big, but it can be something else.
Try and paste the crashdetect log here.
pollo97 is offline   Reply With Quote
Old 07/01/2018, 04:26 PM   #3
Longover
Big Clucker
 
Longover's Avatar
 
Join Date: Oct 2017
Location: Romania
Posts: 190
Reputation: 0
Thumbs down Re: Server:Unknown command.

Quote:
Originally Posted by pollo97 View Post
Probably it's cause from array out of bound error.
Try to install this plugin: https://github.com/Zeex/samp-plugin-crashdetect
After use the command and see if in the console show up some error.

Usually, when i have this kind of problem is for an array index negative or too big, but it can be something else.
Try and paste the crashdetect log here.
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[09:22:49]
[09:22:49] Server Plugins
[09:22:49] --------------
[09:22:49] Loading plugin: Whirlpool
[09:22:49]
[09:22:49] ==================
[09:22:49]
[09:22:49] Whirlpool loaded
[09:22:49]
[09:22:49] ==================
[09:22:49]
[09:22:49] Loaded.
[09:22:49] Loading plugin: sscanf
[09:22:49]

[09:22:49] ===============================

[09:22:49] sscanf plugin loaded.

[09:22:49] Version: 2.8.2

[09:22:49] (c) 2012 Alex "******" Cole

[09:22:49] ===============================

[09:22:49] Loaded.
[09:22:49] Loading plugin: crashdetect
[09:22:49] CrashDetect v4.18.1 is OK.
[09:22:49] Loaded.
[09:22:49] Loading plugin: nativechecker
[09:22:49] Loaded.
[09:22:50] Loading plugin: streamer
[09:22:50]

*** Streamer Plugin v2.9.2 by Incognito loaded ***

[09:22:50] Loaded.
[09:22:50] Loaded 5 plugins.

[09:22:50]
[09:22:50] Filterscripts
[09:22:50] ---------------
[09:22:50] Loading filterscript 'skinchanger.amx'...
[09:22:50]
--Admin Player Skin Changer Loaded

[09:22:50] Loading filterscript 'Case.amx'...
[09:22:50] Loading filterscript 'vspawner.amx'...
[09:22:50]
--Admin Vehicle Spawner Loaded

[09:22:50] Loading filterscript 'VoteKick.amx'...
[09:22:50] Loading filterscript 'engine.amx'...
[09:22:50] -------------------------------------
[09:22:50] -----Engine System By Andybtv-----
[09:22:50] Loading filterscript 'spray.amx'...
[09:22:50] Loaded 6 filterscripts.

[09:22:50]
[09:22:50]
[09:22:50]
[09:22:50] =======================================
[09:22:50] | |
[09:22:50] | YSI version 3.09.0684 |
[09:22:50] | By Alex "******" Cole |
[09:22:50] | |
[09:22:50] =======================================
[09:22:50]
[09:22:50] Server Stats: Vehicule Personale Incarcate
[09:22:52]
Romania Cops and Robbers [Ultra-H.com]


[09:22:52] Number of vehicle models: 118

Not work...
Longover is offline   Reply With Quote
Old 07/01/2018, 09:26 PM   #4
pollo97
Big Clucker
 
pollo97's Avatar
 
Join Date: Sep 2011
Location: Italy
Posts: 83
Reputation: 4
Default Re: Server:Unknown command.

You used the command?
If crashdetect doesn't work you must check manually on for cycle using printf. The problem should probably there.

Code:
print("%d",i);
See when the cycle stop.
pollo97 is offline   Reply With Quote
Old 07/01/2018, 10:31 PM   #5
!R1Ch@rD!
Gangsta
 
!R1Ch@rD!'s Avatar
 
Join Date: Jun 2012
Location: Ecuador
Posts: 649
Reputation: 14
Default Re: Server:Unknown command.

Is the only command not working?
__________________

I want to learn pawno

!R1Ch@rD! 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
Help with YCMD proces command and problem with "Server:Unknown command JoDe Scripting Help 1 20/04/2018 12:12 PM
Problem with command. Only returns Server: Unknown Command Knappen Scripting Help 9 18/12/2013 06:09 PM
Executed ZCMD command returns SERVER: Unknown Command SexTourist Scripting Help 12 03/01/2012 03:38 PM
SERVER: Unknown Command when using a scripted command and it does execute! Moustafa Help Archive 6 11/06/2010 01:34 PM
SERVER: Unknown Command - after login on every command virtualmarc Help Archive 0 20/09/2009 06:27 PM


All times are GMT. The time now is 02:51 PM.


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