29.01.2015, 17:51
pawn Код:
GiveVehicle(playerid,vehicleid, color1, color2)
{
if(!IsPlayerInAnyVehicle(playerid))
{
new Float:x,
Float:y,
Float:z,
Float:angle,
string2[85]
;
if(CreatedVehicle[playerid]) DestroyVehicle(CreatedVehicle[playerid]);
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new veh = CreateVehicle(vehicleid, x, y, z, angle, color1, color2, -1);
SetVehicleVirtualWorld(veh, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(veh, GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, veh, 0);
CreatedVehicle[playerid] = GetPlayerVehicleID(playerid);
format(string2,sizeof(string2),"{00FF00}» Info « {FFFFFF}Vocк criou o veнculo %s ID: %d", VehicleNames[vehicleid-400],vehicleid);
return SendClientMessage(playerid, -1, string2);
}
return 1;
}