SA-MP Forums Archive
DCMD Help - 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 Help (/showthread.php?tid=268126)



DCMD Help - zxc1 - 11.07.2011

How I can use this on DCMD?



Re: DCMD Help - Jeffry - 11.07.2011

pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK) dcmd_exit(playerid, "");
if(newkeys & KEY_SECONDARY_ATTACK) dcmd_enter(playerid, "");
Put in between the " here " the parameters, if there are any (params).

Jeffry


Re: DCMD Help - zxc1 - 11.07.2011

Errors:
Код:
error 017: undefined symbol "dcmd_exit"
error 017: undefined symbol "dcmd_enter"
The commands is:
Код:
command(enter, playerid, params[])
{
	if (PlayerToPoint(4, playerid,2398.0857,133.0009,28.3789))
	{
		SetPlayerInterior(playerid,0);
		SetPlayerPos(playerid,2397.8286,130.2117,70.8653);
	}
	if (PlayerToPoint(4, playerid,1292.6390,380.1429,21.4683))
	{
		SetPlayerInterior(playerid,0);
		SetPlayerPos(playerid,1291.5057,382.6552,63.9558);
	}
	return 1;
}

command(exit, playerid, params[])
{
	if (PlayerToPoint(4, playerid,2397.8286,130.2117,70.8653))
	{
		SetPlayerInterior(playerid,0);
		SetPlayerPos(playerid,2398.0857,133.0009,28.3789);
	}
	if (PlayerToPoint(4, playerid,1291.5057,382.6552,63.9558))
	{
		SetPlayerInterior(playerid,0);
		SetPlayerPos(playerid,1292.6390,380.1429,21.4683);
	}
	return 1;
}



Re: DCMD Help - Jeffry - 11.07.2011

That's not dcmd, is it?

Never worked with such a system you have, but try:

pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK) command(exit, playerid, "");
if(newkeys & KEY_SECONDARY_ATTACK) command(enter, playerid, "");

Jeffry


Re: DCMD Help - Calgon - 11.07.2011

That code is zcmd. This should work:

pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK) cmd_exit(playerid, "");
if(newkeys & KEY_SECONDARY_ATTACK) cmd_enter(playerid, "");
...I gave you the working code, if you don't read this then you're a fool.

EDIT: It should be pointed out that this code will exit a building you're in if you hit 'KEY_SECONDARY_ATTACK' and then enter it again.


Re: DCMD Help - zxc1 - 11.07.2011

Still not working but nevermind.
Thanks anyway...


Re: DCMD Help - Jeffry - 11.07.2011

Or you just place everything of the command under the 'if' statements. This will work for sure then. ^^


Re: DCMD Help - zxc1 - 11.07.2011

Can you explain?


Re: DCMD Help - Jeffry - 11.07.2011

pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK)
{
    //All in one ^^
    if (PlayerToPoint(4, playerid,2397.8286,130.2117,70.8653))
    {
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,2398.0857,133.0009,28.3789);
    }
    if (PlayerToPoint(4, playerid,1291.5057,382.6552,63.9558))
    {
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,1292.6390,380.1429,21.4683);
    }
    if (PlayerToPoint(4, playerid,2398.0857,133.0009,28.3789))
    {
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,2397.8286,130.2117,70.8653);
    }
    if (PlayerToPoint(4, playerid,1292.6390,380.1429,21.4683))
    {
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,1291.5057,382.6552,63.9558);
    }
    return 1;
}
Jeffry


Re: DCMD Help - zxc1 - 11.07.2011

Okay, Thanks.