18.11.2015, 08:16
Can you use this, and tell me what appeared in console/ server log?
PHP код:
forward CarSpawner(playerid,cmodel);
public CarSpawner(playerid,cmodel)
{
if(IsPlayerInAnyVehicle(playerid)) return 1;
if((PlayerInfo[playerid][Level] < 1) && ((cmodel == 425) || (cmodel == 520) || (cmodel == 447) || (cmodel == 464) || (cmodel == 476) || (cmodel == 432))) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be admin to spawn this vehicle");
return 1;
}
else
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new ctsvehicle = CreateVehicle(cmodel, x, y, z, angle, -1, -1, 10000);
PutPlayerInVehicle(playerid, ctsvehicle, 0);
SetVehicleVirtualWorld(ctsvehicle, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(ctsvehicle, GetPlayerInterior(playerid));
VehicleInfo[ctsvehicle][Temp] = 1;
//ChangeVehicleColor(ctsvehicle,0,7);
printf("Vehicle VW: %i, Player VW: %i", GetVehicleVirtualWorld(ctsvehicle), GetPlayerVirtualWorld(playerid));
}
return 1;
}