HELP Cmd
#1

i can make it in cmd? 'zcmd"

/slapcar
Код:
foreach(Player, x)
	{
	    new surf = GetPlayerSurfingVehicleID(x);
		if(surf != INVALID_VEHICLE_ID)
		{
			new Float: fPos[3];
			GetPlayerPos(x, fPos[0], fPos[1], fPos[2]);
			SetPlayerPos(x, fPos[0], fPos[1], fPos[2]+5);
		}
	}
Reply
#2

bump!
Reply
#3

Just read the include topic, it's clearly specified how to create commands.
https://sampforum.blast.hk/showthread.php?tid=91354
Reply
#4

can you give me it in command? please!
Reply
#5

Код:
CMD:slapcar(playerid,params[])
{
  new Float:X;
foreach(Player, X)
	{
	    new surf = GetPlayerSurfingVehicleID(x);
		if(surf != INVALID_VEHICLE_ID)
		{
			new Float: fPos[3];
			GetPlayerPos(X, fPos[0], fPos[1], fPos[2]);
			SetPlayerPos(X, fPos[0], fPos[1], fPos[2]+5);
                }
	}
    return 1;
}
Is this what you want? Anyway, you need ZCMD for this command to work.
Reply
#6

It's clearly described how to create a command.
Reply
#7

Quote:
Originally Posted by karan007
Посмотреть сообщение
Код:
CMD:slapcar(playerid,params[])
{
  new Float:X;
foreach(Player, X)
	{
	    new surf = GetPlayerSurfingVehicleID(x);
		if(surf != INVALID_VEHICLE_ID)
		{
			new Float: fPos[3];
			GetPlayerPos(X, fPos[0], fPos[1], fPos[2]);
			SetPlayerPos(X, fPos[0], fPos[1], fPos[2]+5);
                }
	}
    return 1;
}
Is this what you want? Anyway, you need ZCMD for this command to work.
Yes, and i get errors (

Код:
(5538) : warning 219: local variable "X" shadows a variable at a preceding level
(5540) : error 017: undefined symbol "x"
: warning 203: symbol is never used: "X"
Reply
#8

Because you declared X twice, but you aren't using the Float:X, only the X from your loop.
So just delete the
pawn Код:
new Float:X;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)