Vehicle Script Help
#1

Hello,

I was surfing this forums and then i found a script to spawn vehicles with custom colors. EX: v/ ID COLOR1 COLOR2.
But the script didn't work. So I tried to update the script. but with no luck. Can anyone help me?

Best Regards,
Tigas001
Reply
#2

This is so

pawn Код:
CMD:acar(playerid,params[])
{
    if(pInfo[playerid][pAdmin] >=3)
    {
        new vehicleID,color1,color2;
        if(sscanf(params,"ddd",vehicleID,color1,color2)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /acar [Vehicle ID] [Color 1] [Color 2]");
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateVehicle(vehicleID,X,Y,Z,90,color1,color2,0);
        }
    }
    else
    {
        SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command.");
    }
    return 1;
}
Reply
#3

Got 4 errors
Код:
Microsoft Windows [Versгo 6.1.7601]
Copyright © 2009 Microsoft Corporation. Todos os direitos reservados.

C:\Users\Tigas001>C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\pawncc.ex
e C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\vsc.pwn
Pawn compiler 3.2.3664                  Copyright © 1997-2006, ITB CompuPhase

C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\include\sscanf2.inc(218) :
warning 218: old style prototypes used with optional semicolumns
C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\include\sscanf2.inc(278) :
warning 218: old style prototypes used with optional semicolumns
C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\vsc.pwn(7) : error 017: und
efined symbol "pInfo"
C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\vsc.pwn(7) : warning 215: e
xpression has no effect
C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\vsc.pwn(7) : error 001: exp
ected token: ";", but found "]"
C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\vsc.pwn(7) : error 029: inv
alid expression, assumed zero
C:\Users\Tigas001\Desktop\samp03e_svr_R2_win32\pawno\vsc.pwn(7) : fatal error 10
7: too many error messages on one line

Compilation aborted.
4 Errors.

C:\Users\Tigas001>
The code I'm using is

Код:
#include <a_samp>
#include <ZCMD>
#include <sscanf2>

CMD:acar(playerid,params[])
{
    if(pInfo[playerid][pAdmin] >=3)
    {
        new vehicleID,color1,color2;
        if(sscanf(params,"ddd",vehicleID,color1,color2)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /acar [Vehicle ID] [Color 1] [Color 2]");
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateVehicle(vehicleID,X,Y,Z,90,color1,color2,0);
        }
    }
    else
    {
        SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command.");
    }
    return 1;
}
Reply
#4

Код:
CMD:acar(playerid,params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new vehicleID,color1,color2;
        if(sscanf(params,"ddd",vehicleID,color1,color2)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /acar [Vehicle ID] [Color 1] [Color 2]");
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            CreateVehicle(vehicleID,X,Y,Z,90,color1,color2,0);
        }
    }
    else
    {
        SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command.");
    }
    return 1;
}
( Log into RCON admin to use this. )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)