/getvehicle
#1

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

}
Reply
#2

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

}
Reply
#3

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

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

Deleted
Reply
#5

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.
Reply
#6

CHeck ur pm
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)