[HELP] Can't Spawn Veh In Another World
#1

I have problem, i can't spawn all vehicle in another world..
What is the problem?

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(playeridCOLOR_BRIGHTRED"You must be admin to spawn this vehicle");
        return 
1;
    }
     else
    {
        new 
Float:xFloat:yFloat:zFloat:angle;
         
GetPlayerPos(playeridxyz);
         
GetPlayerFacingAngle(playeridangle);
        new 
ctsvehicle=CreateVehicle(cmodelxyzangle, -1, -110000);
        
PutPlayerInVehicle(playeridctsvehicle0);
        
SetVehicleVirtualWorld(ctsvehicleGetPlayerVirtualWorld(playerid));
        
LinkVehicleToInterior(ctsvehicleGetPlayerInterior(playerid));
        
VehicleInfo[ctsvehicle][Temp] = 1;
        
//ChangeVehicleColor(ctsvehicle,0,7);
    
}
    return 
1;

Thx
Reply
#2

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(playeridCOLOR_BRIGHTRED"You must be admin to spawn this vehicle");
        return 
1;
    }
     else
    {
        new 
Float:xFloat:yFloat:zFloat:angle;
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playeridangle);
        new 
ctsvehicle CreateVehicle(cmodelxyzangle, -1, -110000);
        
PutPlayerInVehicle(playeridctsvehicle0);
        
SetVehicleVirtualWorld(ctsvehicleGetPlayerVirtualWorld(playerid));
        
LinkVehicleToInterior(ctsvehicleGetPlayerInterior(playerid));
        
VehicleInfo[ctsvehicle][Temp] = 1;
        
//ChangeVehicleColor(ctsvehicle,0,7);
        
printf("Vehicle VW: %i, Player VW: %i"GetVehicleVirtualWorld(ctsvehicle), GetPlayerVirtualWorld(playerid));
    }
    return 
1;

Reply
#3

PHP код:

new 
Float:xFloat:yFloat:zFloat:angle
GetPlayerPos(playeridxyz); 
GetPlayerFacingAngle(playeridangle); 

new 
ctsvehicle=CreateVehicle(cmodelxyzangle, -1, -110000); 
SetVehicleVirtualWorld(ctsvehicleGetPlayerVirtualWorld(playerid)); 
LinkVehicleToInterior(ctsvehicleGetPlayerInterior(playerid)); 
PutPlayerInVehicle(playeridctsvehicle0); //<--

VehicleInfo[ctsvehicle][Temp] = 1
//ChangeVehicleColor(ctsvehicle,0,7); 

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)