Car colour
#1

Hi all i've got this car spawner
Код:
if(strcmp(cmd, "/car", true, 10) == 0)
	{
if (gangwar[playerid] == 1) return SendClientMessage(playerid,rossokiaro,"{11d6e0}Usa {d8e064}/leave");
new Float:x, Float:y, Float:z;
if(!strlen(tmp)) return SendClientMessage(playerid, rossokiaro, "Usa /car [nomeveicolo]");
new vehicle = GetVehicleModelIDFromName(tmp);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, rossokiaro, "Non и stato trovato questo veicolo");
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1)
{
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else
{
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
PutPlayerInVehicle(playerid, PlayersVehicle,0);
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
format(stringa, sizeof(stringa), "Hai Spawnato: %s", vehName[vehicle - 400]);
SendClientMessage(playerid, COLOR_GREEN, stringa);
return 1;
}
how can i put the vehicle color? /car name colour1 colour2?
Reply
#2

Use ZCMD, its way easier to use & faster.

Take a look at my command.
pawn Код:
CMD:v(playerid, params[])
{
        new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        if(PlayerInfo[playerid][pAdminLevel] >= 4)
        {
            new vehid;new b1;new b2;
            if(sscanf(params, "iii", vehid,b1,b2)) SendClientMessage(playerid, COLOR_RED, "Use: /v [car id] [color 1] [color 2]");
            else if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, COLOR_RED, "Wrong car id!");
            else
            {
                new Float:x, Float:y, Float:z;new Float:kut;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, kut);
                CreateVehicle(vehid, x + 3, y + 1, z, kut, b1, b2, -1);
                format(string, sizeof(string), "Administrator %s have just created new vehicle %i", name,vehid);
                SendClientMessageToAll(COLOR_RED,string);
            }
        }
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)