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



/getvehicle - NathNathii - 02.03.2013

A friend sent me this cmd, but i need it as zcmd.
If anyone could please help.

pawn Code:
dcmd_getvehicle(playerid,params[])

{

    if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))

        {

            if(!strlen(params)) return

                SendClientMessage(playerid, LIGHTBLUE2, "Usage: /vget [VehicleID]") &&

                SendClientMessage(playerid, orange, "Function: Will Bring the specified Vehicle to your Position");

            new player1;

                new string[128];

            player1 = strval(params);

                SendCommandToAdmins(playerid,"VGet");

                new Float:x, Float:y, Float:z;

                GetPlayerPos(playerid,x,y,z);

                SetVehiclePos(player1,x+3,y,z);

                SetVehicleVirtualWorld(player1,GetPlayerVirtualWorld(playerid));

                format(string,sizeof(string),"You brought the Vehicle ID '%d' to your Position", player1);

                return SendClientMessage(playerid,BlueMsg,string);

        }

        else return ErrorMessages(playerid, 1);

}



Respuesta: /getvehicle - MiGu3X - 02.03.2013

pawn Code:
CMD:getvehicle(playerid,params[])

{

    if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))

        {

            if(!strlen(params)) return

                SendClientMessage(playerid, LIGHTBLUE2, "Usage: /vget [VehicleID]") &&

                SendClientMessage(playerid, orange, "Function: Will Bring the specified Vehicle to your Position");

            new player1;

                new string[128];

            player1 = strval(params);

                SendCommandToAdmins(playerid,"VGet");

                new Float:x, Float:y, Float:z;

                GetPlayerPos(playerid,x,y,z);

                SetVehiclePos(player1,x+3,y,z);

                SetVehicleVirtualWorld(player1,GetPlayerVirtualWorld(playerid));

                format(string,sizeof(string),"You brought the Vehicle ID '%d' to your Position", player1);

                return SendClientMessage(playerid,BlueMsg,string);

        }

        else return ErrorMessages(playerid, 1);

}



Re: /getvehicle - =WoR=Varth - 02.03.2013

https://sampforum.blast.hk/showthread.php?tid=91354

Basically
pawn Code:
COMMAND:mycommand(playerid, params[]) // or CMD:mycommand(playerid, params[])
{  // Do something
  return 1; }



Re: /getvehicle - NathNathii - 02.03.2013

Deleted


Re: /getvehicle - NathNathii - 02.03.2013

8 Errors.

Code:
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(15) : error 017: undefined symbol "LIGHTBLUE2"
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(15 -- 17) : error 017: undefined symbol "orange"
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(21) : warning 217: loose indentation
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(23) : warning 217: loose indentation
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(25) : warning 217: loose indentation
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(25) : error 017: undefined symbol "SendCommandToAdmins"
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(37) : error 017: undefined symbol "BlueMsg"
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(41) : warning 225: unreachable code
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(41) : error 029: invalid expression, assumed zero
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(41) : warning 215: expression has no effect
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(41) : error 001: expected token: ";", but found "return"
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(41) : error 017: undefined symbol "ErrorMessages"
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(41) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.



Respuesta: /getvehicle - MiGu3X - 02.03.2013

CHeck ur pm


Re: /getvehicle - UnknownGamer - 02.03.2013

pawn Code:
CMD:getvehicle(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        new carid, string[128];
        if(sscanf(params, "d", carid)) return SCM(playerid, COLOR_WHITE, "USAGE: /getcar [carid]");
        SendCommandToAdmins(playerid,"VGet");
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid,x,y,z);
        SetVehiclePos(player1,x+3,y,z);
        SetVehicleVirtualWorld(player1,GetPlayerVirtualWorld(playerid));
        format(string,sizeof(string),"You brought the Vehicle ID '%d' to your Position", carid);
        return SCM(playerid,COLOR_WHITE,string);
    }
    else
    {
        SCM(playerid, COLOR_WHITE, "ERROR!");
    }
    return 1;
}
Make sure to define COLOR_WHITE, and SCM, and sccanf2.

#include <sscanf2>
#define SCM SendClientMessage
#define COLOR_WHITE 0xFFFFFFAA

Try this, get back to me if it's broken.