SA-MP Forums Archive
dcmd problem :( - 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: dcmd problem :( (/showthread.php?tid=92770)



dcmd problem :( - [mad]MLK - 22.08.2009

hey im new to dcmd and im redoing my server with it but, i get the following errors with my script:

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

dcmd_test(playerid)

	{
 		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;

	}
	return 0;
}
anyone know why?


Re: dcmd problem :( - HuRRiCaNe - 22.08.2009

which error dude?


Re: dcmd problem :( - Yuryfury - 22.08.2009

I'm taking a wild guess here:

add #pragma unused params
and return 1;
and add a bracket/remove a bracket

pawn Код:
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;

}



Re: dcmd problem :( - [mad]MLK - 22.08.2009

C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(82) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(97) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: dcmd problem :( - Yuryfury - 22.08.2009

Quote:
Originally Posted by [mad
MLK (sampx-hosting.co.cc) ]
C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(82) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(97) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
and what two lines are those?


Re: dcmd problem :( - [mad]MLK - 22.08.2009

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

dcmd_test(playerid)

	{
 		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;

	}
	return 0; = 97 <<<<<<<<<<<<<<<<<<
}



Re: dcmd problem :( - Yuryfury - 22.08.2009

Quote:
Originally Posted by [mad
MLK (sampx-hosting.co.cc) ]
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(test, 4, cmdtext[]);  = 82 <<<<<<<<<<<<<,,
	return 0;
}

dcmd_test(playerid)

	{
 		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;

	}
	return 0; = 97 <<<<<<<<<<<<<<<<<<
}
pawn Код:
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;

}

https://sampwiki.blast.hk/wiki/Fast_Commands
&
http://weedarr.wikidot.com/dcommand
&
http://weedarr.wikidot.com/dcommand2

are good tutorials


Re: dcmd problem :( - [mad]MLK - 22.08.2009

ive looked at all those and non of them tell you how to use anything other then playerid i need it so i can use cmdtext in a command


Re: dcmd problem :( - HuRRiCaNe - 22.08.2009

as yuryfury said
dcmd(test, 4, cmdtext[]);
is
dcmd(test, 4, cmdtext);