SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   /getvehicle (https://forum.sa-mp.com/showthread.php?t=419707)

NathNathii 02/03/2013 12:09 AM

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

}

MiGu3X 02/03/2013 12:17 AM

Respuesta: /getvehicle
 
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);

}

=WoR=Varth 02/03/2013 12:17 AM

Re: /getvehicle
 
http://forum.sa-mp.com/showthread.php?t=91354

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

NathNathii 02/03/2013 12:23 AM

Re: /getvehicle
 
Deleted

NathNathii 02/03/2013 12:36 AM

Re: /getvehicle
 
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 (c) 1997-2006, ITB CompuPhase


8 Errors.


MiGu3X 02/03/2013 12:41 AM

Respuesta: /getvehicle
 
CHeck ur pm

UnknownGamer 02/03/2013 02:29 PM

Re: /getvehicle
 
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.


All times are GMT. The time now is 03:33 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.