Vehicle spawn command
#2

You could always do this

pawn Код:
new sCar[MAX_PLAYERS];
pawn Код:
if(!strcmp(cmdtext, "/scar", false, 5))
{
    if(!strlen(cmdtext[5]) return SendClientMessage(playerid, red, "Usage: /scar [Model ID]");
    new veh = strval(cmdtext[5]);
    if(veh < 400 || veh > 611) return SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x,y,z); GetPlayerFacingAngle(playerid, a);
    sCar[playerid] = CreateVehicle(veh, x,y,z, a, -1, -1, -1);
    return 1;
}
pawn Код:
public OnVehicleDeath(vehicleid)
{
    for(new x; x<MAX_PLAYERS; x++)
    {
        if(sCar[x] != 0) continue;
        if(sCar[x] == vehicleid)
        {
            DestroyVehicle(vehicleid);
            break;
        }
    }
    return 1;
}
Reply


Messages In This Thread
Vehicle spawn command - by Moron - 02.07.2011, 06:24
Re: Vehicle spawn command - by [HiC]TheKiller - 02.07.2011, 06:51
Re: Vehicle spawn command - by Moron - 02.07.2011, 06:55
Re: Vehicle spawn command - by Moron - 02.07.2011, 06:59
Re: Vehicle spawn command - by [HiC]TheKiller - 02.07.2011, 07:31
Re: Vehicle spawn command - by Moron - 02.07.2011, 07:36
Re: Vehicle spawn command - by [HiC]TheKiller - 02.07.2011, 07:59
Re: Vehicle spawn command - by Moron - 02.07.2011, 08:00

Forum Jump:


Users browsing this thread: 1 Guest(s)