[HELP]: /vbike
#1

Hello!

I need help...I have my command /vbike which spawns a bike only for VIPs, but I don't know how to make that, a player can spawn only one bike...I mean when he spawns a bike and then spawns another one, the first one will be deleted...

Here is my command:


pawn Код:
CMD:vbike(playerid, params[])
{
    if(pInfo[playerid][VIPlevel] < 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You aren't a VIP");
    new Float:up[3], bike;
    GetPlayerPos(playerid, up[0], up[1], up[2]);
    bike = CreateVehicle(522, up[0]+2, up[1]+2, up[2], 0, -1, -1, 0);
    PutPlayerInVehicle(playerid, bike, 0);
    return 1;
}
Thanks
Reply
#2

For an example:
Код:
public OnVehicleSpawn(vehicleid)
{
	foreach(new i : Player)
	{
        if(vehicleid==pCar[i])
		{
		    if(pCar[i] != -1)
		    {
				if(!IsPlayerInVehicle(i, pCar[i])) DestroyVehicle(pCar[i]);
		    }
	        pCar[i]=-1;
        }
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)