cmd help
#1

i use ZCMD for making commands

i want to make a cmd:gotovirtualworld

the player stays in the same location where he was standing but he will just get into virtual world.

and i want it to say "welcome to virtual world"

and 2nd cmd:exitvirtualworld

"you are now out of virtual world.



Thanks
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerVirtualWorld
And to make "Welcome to Virtual world"
pawn Код:
GameTextForPlayer(playerid, "~w~Welcome to virtual world", 5000, 3);
You can also edit color or text style
https://sampwiki.blast.hk/wiki/GameTextStyle
Код:
 Text Colors

    ~n~ New line 

    ~r~ Red 

    ~g~ Green 

    ~b~ Blue 

    ~w~ White 

    ~y~ Yellow 

    ~p~ Purple 

    ~l~ Black 

    ~h~ Turn text colour lighter (used too much will make your text white, doesn't work on black)
/exitvirtualworld

pawn Код:
SetPlayerPos(playerid,Float:x,Float:y,Float:z),
edit Float,Float:y,Float:z to what ever position you want.
Reply
#3

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;
}
Reply
#4

pawn Код:
/virtualworld
{
      SetPlayerVirtuaWorld(playerid, 1);
      GameTextForPlayer(playerid, "~r~Welcome to virtual World, 5000, 5");
      return 1;
}
and exiting the virtual world

pawn Код:
/exitvirtualworld
{
       SetPlayerVirtualWorld(playerid, 0);
       GameTextForPlayer(playerid, "~y~Welcome to Real World, 5000, 5");
       return 1;
}
Reply
#5

thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)