Spawn Vehicle /v with the Name or just ID
#1

Peace ..,

I have a "/v" spawning vehicles system with only the Name, EX: /v Infernus
Now I need also how to make /v ID like: /v 411

With this following code:
pawn Код:
dcmd_v(playerid,params[])
{
        new Index;
        new tmp[256];  tmp  = strtok(params,Index);
        new tmp2[256]; tmp2 = strtok(params,Index);
        new tmp3[256]; tmp3 = strtok(params,Index);
        if(PlayerInterior[playerid] > 1) return SendClientMessage(playerid,RED, "You can't spawn a vehicle inside houses / hotels / ..."); // xD
        if(!strlen(tmp)) return
        SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /v [Name] [Colour1] [Colour2]");
        new car;
        new string[128];
        new colour1, colour2;
        if(!IsNumeric(tmp))
        car = GetVehicleModelIDFromName(tmp);
        else car = strval(tmp);
        if(car < 400 || car > 611) return  SendClientMessage(playerid, BALTA, "Invalid Name!");
        if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
        if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
        new Float:X,Float:Y,Float:Z;
        new Float:Angle,int1;
        GetPlayerPos(playerid, X,Y,Z);
        GetPlayerFacingAngle(playerid,Angle);
        int1 = GetPlayerInterior(playerid);
        Car[playerid] = CreateVehicle(car, X,Y,Z, Angle, colour1, colour2, 60*10000); //-1
        LinkVehicleToInterior(Car[playerid],int1);
    }
Please !
Reply


Messages In This Thread
Spawn Vehicle /v with the Name or just ID - by Yaszine - 08.01.2011, 11:19
Re : Spawn Vehicle /v with the Name or just ID - by Yaszine - 08.01.2011, 17:13
Re : Spawn Vehicle /v with the Name or just ID - by Yaszine - 08.01.2011, 19:38
Re: Spawn Vehicle /v with the Name or just ID - by Mean - 08.01.2011, 21:50
Re : Spawn Vehicle /v with the Name or just ID - by Yaszine - 09.01.2011, 18:08

Forum Jump:


Users browsing this thread: 1 Guest(s)