16.01.2016, 13:33
PHP код:
GiveVehicle(playerid, vehicleid, color1, color2)
{
if(!IsPlayerInAnyVehicle(playerid))
{
if(CreatedVehicle[playerid]) {
DestroyVehicle(CreatedVehicle[playerid]);
CreatedVehicle[playerid] = 0;
}
new Float:x, Float:y, Float:z, Float:angle, string2[85];
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
CreatedVehicle[playerid] = CreateVehicle(vehicleid, x, y, z, angle, color1, color2, -1);
SetVehicleVirtualWorld(CreatedVehicle[playerid], GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(CreatedVehicle[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, CreatedVehicle[playerid], 0);
format(string2,sizeof(string2),"{FF0000}INFO SERVE{FFFFFF}Vocк criou o veнculo %s ID: %d", VehicleNames[vehicleid-400],vehicleid);
SendClientMessage(playerid, -1, string2);
return 1;
}
return 0;
}