Need Help, Problem with Command
#1

So When I first tried my command it works properly and such, now I wanted to add a a parameter to my command so I downloaded the sscanf.inc file and put it in my pawno>include folder, then I put an include statement to include the sscanf function, #include <sscanf2>, I decided to run my script to see if it still worked with no modfication to the code except for that include statement for sscanf2, when I tried to see if my command worked it said SERVER:UNKNOWN COMMAND, it didnt recognize the command, i decided to take the include out to see if my commanad would work again, and voila it worked again after I deleted the sscanf include statement. Im not sure what is the problem but can someone help me out?! Here is the code with the #Include <sscanf2> statement:

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript

#define FILTERSCRIPT

#include <a_samp>
#include <sscanf2>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	
	if (strcmp("/test", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid,0x00AAFF,"this works");
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Reply
#2

I don't understand what you're trying to do. Please explain it abit more.
Reply
#3

I wanted to add more functionality to my command using sscanf so I can add some parameters to the command, but whenever I add the #include <sscanf2> statement, it breaks my command and wont run it, I havent even used sscanf yet just simply adding the include statement makes the command stop working and isnt recognizable by the server, why would this happen?! WHen I took the include statement for sscanf out it worked again.
Reply
#4

Okay, well what command processor are you using? I recommend ZCMD which is really easy and works well with sscanf. What command are you trying to create?
Reply
#5

Quote:
Originally Posted by Binx
Посмотреть сообщение
Okay, well what command processor are you using? I recommend ZCMD which is really easy and works well with sscanf. What command are you trying to create?
Im not using any command processor, im just using the basic callback for commands public OnPlayerCommandText(playerid, cmdtext[]), I will try ZCMD once I get this problem solved, and im trying to create a simple teleport command from scratch, but right now its not even about the command itself, its the fact that it breaks after I add the include statement for sscanf in.
Reply
#6

I also found something odd, when I start my server why does my filterscript appear under the "admin vehicle spawner Loaded" category instead of appearing under the filterscripts category?!
Reply
#7

well, a teleport command aint that hart, just: setplayerposition :P
Reply
#8

Quote:
Originally Posted by ThaCrypte
Посмотреть сообщение
well, a teleport command aint that hart, just: setplayerposition :P
Jesus christ, its not about the command, didnt you read anything I wrote up there?! I said my test command doesnt work after I add in the include statement of the sscanf function, #include <sscanf2>, after I add that in my test command doesnt work!!
Reply
#9

Download the ZCMD include and try it.
Reply
#10

Quote:
Originally Posted by Binx
Посмотреть сообщение
Download the ZCMD include and try it.
I did that already, i downloaded the zcmd plugin and included the zcmd function using the #include <zcmd> statement, (I took out the sscanf include just to see if it would break with the zcmd include), and it did break with the zcmd include statement, after I took out the zcmd include it worked again! Isnt that weird?!?!?! What could the problem be?!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)