A little help?
#2

Here you go
I hope i helped you.


Код:
new PlayerCar[playerid];

// /v command with ZCMD and sscanf:
COMMAND:v(playerid, params[])
{
	new carid, color1, color2;
    if(sscanf(params,"ddd", carid, color1, color2))return SendClientMessage(playerid, GREY, "USAGE: /v [carid] [color1] [color2]");
    if(carid < 400 || carid > 611) return SendClientMessage(playerid, GREY, "Cars IDs can't be below 400 or above 611!");
    else
	{
        if(color1 < 0 || color1 > 126) return SendClientMessage(playerid, GREY, "Color number can't be below 0 or above 160!");
        if(color2 < 0 || color2 > 126) return SendClientMessage(playerid, GREY, "Color number can't be below 0 or above 160!");
        new Float: X,Float: Y,Float: Z;
        GetPlayerPos(playerid, X,Y,Z);
        CreateVehicle(carid, X,Y,Z, 0.0, color1, color2, 60000);
        PutPlayerInVehicle(playerid, carid, 0);
        PlayerCar[playerid] = carid;
    }
    return 1;
}

// To despawn the vehicle when the player leaves it
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(PlayerCar[playerid] == vehicleid)
    {
        DestroyVehicle(PlayerCar[playerid]);
        return 1;
    }   
    return 1;
}
Reply


Messages In This Thread
A little help? - by BMan17 - 27.12.2011, 23:46
Re: A little help? - by Soumi - 27.12.2011, 23:55
Re: A little help? - by BMan17 - 28.12.2011, 00:14
Respuesta: A little help? - by [Nikk] - 28.12.2011, 00:54
Re: Respuesta: A little help? - by BMan17 - 28.12.2011, 01:05

Forum Jump:


Users browsing this thread: 2 Guest(s)