There you go bro
pawn Код:
CMD:vworld(playerid,params[]) //you need zcmd include
{
SetPlayerVirtualWorld(playerid,1); //Setting player's virtual world
GameTextForPlayer(playerid, "~r~welcome to virtual world", 5000, 3); //Sendiing game text on screen for the player! That he have successfully changed his virtual world!
return 1;
}
This piece of code will just set you world to 1!
But if you want the virtual world to be entered by you! There you go!
I made it like so admins can change other's player world!
pawn Код:
CMD:setworld(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 3) { //Checking if player has sufficient level
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); //making two containers to store data
if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setworld [playerid] [virtual world]");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
format(string, sizeof(string), "You have set \"%s's\" virtual world to '%d'", pName(player1), time); SendClientMessage(playerid,blue,string);
if(player1 != playerid) { format(string,sizeof(string),"Administrator \"%s\" has set your virtual world to '%d' ", pName(playerid), time); SendClientMessage(player1,blue,string); }
PlayerPlaySound(player1,1057,0.0,0.0,0.0);
return SetPlayerVirtualWorld(player1, time);
} else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
And changing back to the normal world we use!
pawn Код:
CMD:exitvirtualworld(playerid,params[]) //you need zcmd include
{
SetPlayerVirtualWorld(playerid,0); //Setting player's virtual world
GameTextForPlayer(playerid, "~r~Exitted the virtual world", 5000, 3); //Sendiing game text on screen for the player! That he have successfully exited his virtual world!
return 1;
}