I need /veh CarID color1 color2 command!
#1

Can someone post the /veh CarID color1 color2 command?
And can someone make it RCON Admin only?
Reply
#2

Ask in script request topic.
Reply
#3

this command is taken from the GF GM
pawn Код:
}
    if(strcmp(cmd, "/veh", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if (PlayerInfo[playerid][pAdmin] < 4)
            {
              SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
              return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "  Vehicle Number can't be below 400 or above 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "  Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "  Color Number can't be below 0 or above 126 !"); return 1; }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
            CreatedCars[CreatedCar] = carid;
            CreatedCar ++;
            format(string, sizeof(string), "  Vehicle %d spawned.", carid);
            SendClientMessage(playerid, COLOR_GREY, string);
        }
        return 1;
Reply
#4

pawn Код:
if(strcmp(cmd, "/veh", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(!IsPlayerAdmin(playerid))
            {
              SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
              return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "  Vehicle Number can't be below 400 or above 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "  Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "  Color Number can't be below 0 or above 126 !"); return 1; }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
            format(string, sizeof(string), "  Vehicle %d spawned.", carid);
            SendClientMessage(playerid, COLOR_GREY, string);
        }
        return 1;
    }
Edited James' post, this will work for RCON administrators.
Reply
#5


Код:
C:\Users\Jeffrey\Desktop\UnitedRP\crp.pwn(1780) : error 035: argument type mismatch (argument 2)
line 1780:
Код:
			GetPlayerPos(playerid, X,Y,Z);
Reply
#6

Quote:
Originally Posted by JPonsen
Код:
C:\Users\Jeffrey\Desktop\UnitedRP\crp.pwn(1780) : error 035: argument type mismatch (argument 2)
line 1780:
Код:
			GetPlayerPos(playerid, X,Y,Z);
CRP is sexy, I'm using it right now, here's the code I use for CRP:

pawn Код:
if(strcmp(cmd, "/aspawncar", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if (PlayerInfo[playerid][pAdmin] < 3)
            {
              SendClientMessage(playerid, COLOR_GRAD1, "Bad level.");
              return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "SYNTAX - /aspawncar [carid]");
                return 1;
            }
            new car;
            car = strvalEx(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, "IDs must be between 400 and 611."); return 1; }
      new Float:XX, Float:YY, Float:ZZ;
            GetPlayerPos(playerid, XX,YY,ZZ);
            new carsp = CreateVehicle(car, XX,YY,ZZ, 0.0, -1, -1, -1);
            LinkVehicleToInterior(carsp, GetPlayerInterior(playerid));
            SendClientMessage(playerid, COLOR_WHITE, "Successfully spawned.");
        }
        return 1;
    }
Reply
#7

Код:
C:\Users\Jeffrey\Desktop\UnitedRP\crp.pwn(1759) : error 017: undefined symbol "strvalEx"
line 1759:
Код:
			car = strvalEx(tmp);
Reply
#8

Quote:
Originally Posted by JPonsen
Код:
C:\Users\Jeffrey\Desktop\UnitedRP\crp.pwn(1759) : error 017: undefined symbol "strvalEx"
line 1759:
Код:
			car = strvalEx(tmp);
Sorry, rename strvalEx() to strval().
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)