Problem with DCMD and user crashing
#1

hi. I changed all of my teleports from strcmp to dcmd (faster) problem is that in other filter scripts strcmp's don't work anyone. but before i tried dcmd it was already in a admin FS and it never interfered with other stuff.

also- for some unknow reason people in my server crash alot. when someone crashes its not just 1 person it can be 3-15 people that will crash. sometimes someone will timeout when someone joins. Im kinda stunt on it. Its not a object/car problem.

Reply
#2

You use '#pragma unused params'?

Copy here one Teleport Command.
Reply
#3

Код:
#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(skroad, 6, cmdtext);
     return1;
}

dcmd_skroad(playerid, params[])
{
	#pragma unused params
	SetPlayerInterior(playerid, 0);
	ResetPlayerWeapons(playerid);
	SetPlayerPos(playerid,3893.8152, -1623.4252, 1442.5);
	GameTextForPlayer(playerid,"SKROAD",2500,3);
	SetCameraBehindPlayer(playerid);
	return 1;
}
thats how its setup
Reply
#4

I think that the "params" are the reason for the crash. I've noticed that this sometimes happens on my server too. Try using "cmdtext" instead of "params". Example:

pawn Код:
dcmd_skroad(playerid, cmdtext)
{
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,3893.8152, -1623.4252, 1442.5);
GameTextForPlayer(playerid,"SKROAD",2500,3);
SetCameraBehindPlayer(playerid);
return 1;
}
But if that doesn't work, then try this one:

pawn Код:
dcmd_skroad(playerid, cmdtext[])
{
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,3893.8152, -1623.4252, 1442.5);
GameTextForPlayer(playerid,"SKROAD",2500,3);
SetCameraBehindPlayer(playerid);
return 1;
}
Reply
#5

well this is really weird cause since im using dcmd is 1 FS strcmp is disabled or something then it doesent work
Reply
#6

Did my code work? ~_~
Reply
#7

ims till testing. something is is weird. commands that are wrong like if I type /jfdshfdskjsdfdj it wont say SERVER: Unknown Command Anymore.
Reply
#8

That's maybe cause of some bugged commands. That happened to me once before. When I typed something like "/asdasdsaassdasadasdaasdasdasd", then it said "[ERROR]: You must be in a vehicle". And that text was from my "/nos" command. XD
Reply
#9

Quote:
Originally Posted by cοοp
That's maybe cause of some bugged commands. That happened to me once before. When I typed something like "/asdasdsaassdasadasdaasdasdasd", then it said "[ERROR]: You must be in a vehicle". And that text was from my "/nos" command. XD
Your Code - (both)

Код:
C:\DOCUME~1\Braeden\Desktop\SA\MYNEWE~1\FILTER~1\commands.pwn(666) : error 017: undefined symbol "params"
203: symbol is never used: "cmdtext"
C:\DOCUME~1\Braeden\Desktop\SA\MYNEWE~1\FILTER~1\commands.pwn(3146) : warning 203: symbol is never used: "cmdtext"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase ETC


2 Errors.
Reply
#10

Add this on the top of your script:

pawn Код:
#pragma unused cmdtext
OR do like this:

pawn Код:
dcmd_skroad(playerid, cmdtext)
{
#pragma unused cmdtext
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,3893.8152, -1623.4252, 1442.5);
GameTextForPlayer(playerid,"SKROAD",2500,3);
SetCameraBehindPlayer(playerid);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)