SA-MP Forums Archive
Car colour - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car colour (/showthread.php?tid=462587)



Car colour - XxXBr0nXxX - 07.09.2013

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?


Re: Car colour - SeniorGamer - 08.09.2013

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;
}