SA-MP Forums Archive
small problem with dcmd : / - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: small problem with dcmd : / (/showthread.php?tid=92793)



small problem with dcmd : / - [mad]MLK - 22.08.2009

Код:
this is my code :

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(test, 4, cmdtext);
return 0;
}

dcmd_test(playerid, params[])

{
     #pragma unused params
  new pname[24], string[128];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string, sizeof(string), "%s is PRO!", pname);
  SendClientMessage(playerid, 0x00FF00AA, "this was a test");
  SendClientMessageToAll(0x00FF00AA, string);
  return 1;
}

{
	dcmd(seafun, 6, cmdtext);
	return 0;
}

dcmd_seafun(playerid, params[])

{
		#pragma unused params
	SetPlayerPos(playerid, 2450.2224, -1788.5258, 458.3834);
	new pname[24], string[128];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(string, sizeof(string), "[Teleport] %s Has gone to /seafun", pname);
	SendClientMessage(playerid, 0x00FF00AA, "You have teleported to seafun.");
	SendClientMessageToAll(0x00FF00AA, string);
	return 1;

}
ERRORS:
C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(728) : error 055: start of function body without function header
C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(729) : error 010: invalid function or declaration
C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(730) : error 010: invalid function or declaration
C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(896) : warning 203: symbol is never used: "dcmd_seafun"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
LINE 728:
Код:
{
LINE 729:
Код:
	dcmd(seafun, 6, cmdtext);
LINE 730:
Код:
return 0;
LINE 896:
Код:
(Nothing there gm ends at 895)
someone help?



Re: small problem with dcmd : / - Joe Staff - 22.08.2009

You already have a topic with this issue.

Make sure you have DCMD defined. Search wiki.sa-mp.com for it.


Re: small problem with dcmd : / - NeRoSiS - 22.08.2009

This code


Код:
{
	dcmd(seafun, 6, cmdtext);
	return 0;
}
needs to be with this.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(test, 4, cmdtext);
return 0;
}
Like this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(test, 4, cmdtext);
dcmd(seafun, 6, cmdtext);
return 0;
}
Going to spain nao xD



Re: small problem with dcmd : / - [mad]MLK - 22.08.2009

how could i get cmdtext to work in a dcmd command?


Re: small problem with dcmd : / - refshal - 22.08.2009

Did you even include the dcmd function? https://sampwiki.blast.hk/wiki/Dcmd


Re: small problem with dcmd : / - [mad]MLK - 22.08.2009

if you're refering to this
Код:
#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
Yes.
but how would i make it so that in a command i could use cmdtext


Re: small problem with dcmd : / - [mad]MLK - 22.08.2009

?