small problem with dcmd : /
#1

Код:
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?
Reply
#2

You already have a topic with this issue.

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

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
Reply
#4

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

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

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

?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)