HELP Cmd - 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)
+--- Thread: HELP Cmd (
/showthread.php?tid=569203)
HELP Cmd -
SHFaCeBook - 28.03.2015
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);
}
}
Re: HELP Cmd -
SHFaCeBook - 28.03.2015
bump!
Re: HELP Cmd -
CalvinC - 29.03.2015
Just read the include topic, it's clearly specified how to create commands.
https://sampforum.blast.hk/showthread.php?tid=91354
Re: HELP Cmd -
SHFaCeBook - 29.03.2015
can you give me it in command? please!
Re: HELP Cmd -
Karan007 - 29.03.2015
Код:
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.
Re: HELP Cmd -
CalvinC - 29.03.2015
It's clearly described how to create a command.
Re: HELP Cmd -
SHFaCeBook - 29.03.2015
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"
Re: HELP Cmd -
CalvinC - 29.03.2015
Because you declared X twice, but you aren't using the Float:X, only the X from your loop.
So just delete the