how to fix Virtual World - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to fix Virtual World (
/showthread.php?tid=475794)
how to fix Virtual World -
Le3aT - 15.11.2013
I want to know how to fix the virtual world
like /fixvw
Re: how to fix Virtual World -
TahaAsif12 - 15.11.2013
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!
Re: how to fix Virtual World -
Konstantinos - 15.11.2013
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.
Re: how to fix Virtual World -
Jizz - 15.11.2013
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;
}