SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/03/2013, 12:09 AM   #1
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Question /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);

}
NathNathii is offline   Reply With Quote
Old 02/03/2013, 12:17 AM   #2
MiGu3X
Huge Clucker
 
Join Date: Jan 2013
Posts: 223
Reputation: 6
Default 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);

}
MiGu3X is offline   Reply With Quote
Old 02/03/2013, 12:17 AM   #3
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 1,988
Reputation: 133
Default 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; }
__________________
(RETIRED)
=WoR=Varth is offline   Reply With Quote
Old 02/03/2013, 12:23 AM   #4
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Exclamation Re: /getvehicle

Deleted
NathNathii is offline   Reply With Quote
Old 02/03/2013, 12:36 AM   #5
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default 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.
NathNathii is offline   Reply With Quote
Old 02/03/2013, 12:41 AM   #6
MiGu3X
Huge Clucker
 
Join Date: Jan 2013
Posts: 223
Reputation: 6
Default Respuesta: /getvehicle

CHeck ur pm
MiGu3X is offline   Reply With Quote
Old 02/03/2013, 02:29 PM   #7
UnknownGamer
Gangsta
 
UnknownGamer's Avatar
 
Join Date: Apr 2012
Location: 127.0.0.1
Posts: 518
Reputation: 39
Default 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.
UnknownGamer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 12:11 PM.


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