how to fix Virtual World
#1

I want to know how to fix the virtual world

like /fixvw
Reply
#2

Here Is A Simple Command To Set Someone Interior.

Код:
CMD:setvw(playerid, params[])
{
	if(IsPlayerAdmin(playerid)) //This will check if player is RCON logged
	{
		new string[128], giveplayerid, vw; //this will get the player's id
		if(sscanf(params, "ud", giveplayerid, vw)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setvw [playerid] [virtual world]");

		if(IsPlayerConnected(giveplayerid))// this check if player is connected
		{
			PlayerInfo[giveplayerid][pVW] =  vw;
			SetPlayerVirtualWorld(giveplayerid,  vw); //this set the plyer's virtual world
			format(string, sizeof(string), "You have set %s's virtual world to %d.", //this notifies the playerGetPlayerNameEx(giveplayerid),  vw);
			SendClientMessageEx(playerid, COLOR_GRAD2, string);

		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!"); //if the player is not RCON logged, the client will send him this message
	}
	return 1;
}
Hope i helped!
Reply
#3

Quote:
Originally Posted by TahaAsif12
Посмотреть сообщение
Here Is A Simple Command To Set Someone Interior.

[..]
Virtual World* and no, don't paste from another script and confuse him more.

pawn Код:
CMD:fixvw( playerid, params[ ] )
{
    new
        worldid
    ;
    if( sscanf( params, "i", worldid ) ) return SendClientMessage( playerid, -1, "Usage: /fixvw <worldid>" );
    if( GetPlayerVirtualWorld( playerid ) == worldid ) return SendClientMessage( playerid, -1, "You're already in that virtual world" );
    switch( GetPlayerState( playerid ) )
    {
        case PLAYER_STATE_ONFOOT: SetPlayerVirtualWorld( playerid, worldid );
        case PLAYER_STATE_DRIVER:
        {
            new
                vehicleid = GetPlayerVehicleID( playerid )
            ;
            SetVehicleVirtualWorld( vehicleid, worldid );
            SetPlayerVirtualWorld( playerid, worldid );
            PutPlayerInVehicle( playerid, vehicleid, 0 );
        }
        case PLAYER_STATE_PASSENGER:
        {
            RemovePlayerFromVehicle( playerid );
            SetPlayerVirtualWorld( playerid, worldid );
        }
        default: SendClientMessage( playerid, -1, "You cannot change the virtual world at the moment!" );
    }
    return 1;
}
that changes the virtual world of the player and of the vehicle too if the player is driver.
Reply
#4

pawn Код:
CMD:fixmyvw(playerid, params[])
{
    new string[128];
    if(IsPlayerConnected(playerid))
    {
        PlayerInfo[playerid][pInt] = 0;
        SetPlayerInterior(playerid, 0);
        PlayerInfo[playerid][pVW] =  0;
        SetPlayerVirtualWorld(playerid,  0);
        format(string, sizeof(string), "You have fixed your virtual world.");
        SendClientMessage(playerid, COLOR_GRAD2, string);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)