Virtualworld problem
#4

Add this under 'new giveplayerid...'

Код:
new cvw = GetPlayerVehicleID(playerid);
Add this:

Код:
if(IsPlayerInVehicle(playerid))
{
     PlayerInfo[giveplayerid][pVW] =  vw; 
     SetPlayerVirtualWorld(giveplayerid,  vw); 
     format(string, sizeof(string), "You have set %s's virtual world to %d.", GetPlayerNameEx(giveplayerid),  vw); 
     SendClientMessageEx(playerid, COLOR_GRAD2, string); 
     SetVehicleVirtualWorld(cvw, vw);
}
Example of command:
Код:
CMD:setvw(playerid, params[]) 
{ 
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command."); 
    new giveplayerid, vw; 
    if(sscanf(params, "ud", giveplayerid, vw)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setvw [player] [virtual world]"); 
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified."); 
    new string[128]; 
    if(GetPVarInt(giveplayerid, "IsInArena") >= 0) 
    { 
        SetPVarInt(playerid, "tempPBP", giveplayerid); 
        format(string, sizeof(string), "%s (ID: %d) is currently in an active Paintball game.\n\nDo you want to force this player out?", GetPlayerNameEx(giveplayerid), giveplayerid); 
        ShowPlayerDialog(playerid, PBFORCE, DIALOG_STYLE_MSGBOX, "Paintball", string, "Yes", "No"); 
        return 1; 
    } 
    if(IsPlayerInVehicle(playerid))
    {
     PlayerInfo[giveplayerid][pVW] =  vw; 
     SetPlayerVirtualWorld(giveplayerid,  vw); 
     format(string, sizeof(string), "You have set %s's virtual world to %d.", GetPlayerNameEx(giveplayerid),  vw); 
     SendClientMessageEx(playerid, COLOR_GRAD2, string); 
     SetVehicleVirtualWorld(cvw, vw);
    }
else
{
    PlayerInfo[giveplayerid][pVW] =  vw; 
    SetPlayerVirtualWorld(giveplayerid,  vw); 
    format(string, sizeof(string), "You have set %s's virtual world to %d.", GetPlayerNameEx(giveplayerid),  vw); 
    SendClientMessageEx(playerid, COLOR_GRAD2, string); 
    return 1; 
}
}
Adjust it a bit in pawno, post errors here if any
Reply


Messages In This Thread
Virtualworld problem - by IndependentGaming - 04.10.2016, 16:32
Re: Virtualworld problem - by AndreiWow - 04.10.2016, 16:36
Re: Virtualworld problem - by IndependentGaming - 04.10.2016, 16:37
Re: Virtualworld problem - by AndreiWow - 04.10.2016, 16:52
Re: Virtualworld problem - by IndependentGaming - 04.10.2016, 17:35
Re: Virtualworld problem - by X337 - 04.10.2016, 17:43
Re: Virtualworld problem - by IndependentGaming - 04.10.2016, 17:58
Re: Virtualworld problem - by IndependentGaming - 04.10.2016, 19:00
Re: Virtualworld problem - by IndependentGaming - 04.10.2016, 21:05
Re: Virtualworld problem - by IndependentGaming - 05.10.2016, 17:52

Forum Jump:


Users browsing this thread: 1 Guest(s)