Server:Unknown command.
#1

Hello! I'm have a problem...
When i'm type /mycars
i'm see a message in chat:
Код:
Server:Unknown command.
But my server have this command:
Код:
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!
Reply
#2

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.
Reply
#3

Quote:
Originally Posted by pollo97
Посмотреть сообщение
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, ©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] © 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...
Reply
#4

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

Код:
print("%d",i);
See when the cycle stop.
Reply
#5

Is the only command not working?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)