help!!!
#1

i wanna make a menu when people comme in the game they choose a world would anybody have cause i made one but its buggy i got 4 world and when people choose world they get brout to a place you choose a avatar and they it pops up the dialog choos a world pleas help
Reply
#2

I don't understand you.
Reply
#3

like you know when you enter server a dialog will open saying choose a team my team are freeroam , stunt , drift and dm and when you click one you spawn in a vw 1 and you choose a class how can i do this.
Reply
#4

after choosing world you spawn and need to choose a class and you spawn and all 4 world are seperated
Reply
#5

nobodsy can help
Reply
#6

This is an example, on how you could do this. Just add your code after they select a virtual world in the "SpawnPlayerInVirtualWorld" function.

pawn Код:
new WorldType[MAX_PLAYERS]; //We will store the player's world type in this array

#define FREEROAM_ID     0
#define STUNT_ID        1
#define DRIFT_ID        2
#define DM_ID           3

public OnPlayerConnect(playerid)
{
    //Make the player select a virtual world
    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select World", "Freeroam\nStunt\nDrift\nDM", "Select", "");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        switch(listitem)
        {
            case 0..3: SpawnPlayerInWorld(playerid, listitem); //Call the function "SpawnPlayerInWorld", when the player selects a item on the list
        }
    }
    return 0;
}

stock SpawnPlayerInWorld(playerid, worldid)
{
    switch(worldid)
    {
        case 0:
        {
            WorldType[playerid] = FREEROAM_ID;
            SetPlayerVirtualWorld(playerid, FREEROAM_ID);
            //Add your code here if they selected freeroam
        }
        case 1:
        {
            WorldType[playerid] = STUNT_ID;
            SetPlayerVirtualWorld(playerid, STUNT_ID);
            //Add your code here if they selected stunt
        }
        case 2:
        {
            WorldType[playerid] = DRIFT_ID;
            SetPlayerVirtualWorld(playerid, DRIFT_ID);
            //Add your code here if they selected drift
        }
        case 3:
        {
            WorldType[playerid] = DM_ID;
            SetPlayerVirtualWorld(playerid, DM_ID);
            //Add your code here if they selected DM
        }
    }
    return 0;
}
Reply
#7

From what I understood, it would be like this:

PHP код:
public OnPlayerConnect(playerid)
{
    
ShowPlayerDialog(playerid,742,DIALOG_STYLE_LIST,"Choose your team:","Freeroam\nStunt\nDrift\nDM","Select""Close");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 742)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
SendClientMessage(playerid0xFFFF00FF"You choosed \"FreeRoam\".");
                
SetPlayerVirtualWorld(playerid0);
            }
            else if(
listitem == 1)
            {
                
SendClientMessage(playerid0xFFFF00FF"You choosed \"Stunt\".");
                
SetPlayerVirtualWorld(playerid1);
            }
            else if(
listitem == 2)
            {
                
SendClientMessage(playerid0xFFFF00FF"You choosed \"Drift\".");
                
SetPlayerVirtualWorld(playerid2);
            }
            else if(
listitem == 3)
            {
                
SendClientMessage(playerid0xFFFF00FF"You choosed \"DM\".");
                
SetPlayerVirtualWorld(playerid3);
            }
            
SpawnPlayer(playerid);
        }
    }
    return 
1;

Reply
#8

Quote:
Originally Posted by PotH3Ad
Посмотреть сообщение
This is an example, on how you could do this. Just add your code after they select a virtual world in the "SpawnPlayerInVirtualWorld" function.

pawn Код:
new WorldType[MAX_PLAYERS]; //We will store the player's world type in this array

#define FREEROAM_ID     0
#define STUNT_ID        1
#define DRIFT_ID        2
#define DM_ID           3

public OnPlayerConnect(playerid)
{
    //Make the player select a virtual world
    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select World", "Freeroam\nStunt\nDrift\nDM", "Select", "");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        switch(listitem)
        {
            case 0..3: SpawnPlayerInWorld(playerid, listitem); //Call the function "SpawnPlayerInWorld", when the player selects a item on the list
        }
    }
    return 0;
}

stock SpawnPlayerInWorld(playerid, worldid)
{
    switch(worldid)
    {
        case 0:
        {
            WorldType[playerid] = FREEROAM_ID;
            SetPlayerVirtualWorld(playerid, FREEROAM_ID);
            //Add your code here if they selected freeroam
        }
        case 1:
        {
            WorldType[playerid] = STUNT_ID;
            SetPlayerVirtualWorld(playerid, STUNT_ID);
            //Add your code here if they selected stunt
        }
        case 2:
        {
            WorldType[playerid] = DRIFT_ID;
            SetPlayerVirtualWorld(playerid, DRIFT_ID);
            //Add your code here if they selected drift
        }
        case 3:
        {
            WorldType[playerid] = DM_ID;
            SetPlayerVirtualWorld(playerid, DM_ID);
            //Add your code here if they selected DM
        }
    }
    return 0;
}
Is it Like A dialog like the server http://forum.sa-mp.com/showthread.ph...hlight=WFM_3.1
Im looking for something like that server has 4 worlds just like it.
Reply
#9

I updated the code:

PHP код:
public OnPlayerConnect(playerid)
{
    
ShowPlayerDialog(playerid,742,DIALOG_STYLE_LIST,"Choose your team:","Freeroam\nStunt\nDrift\nDM","Select""Close");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 742)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
SendClientMessage(playerid0xFFFF00FF"You choosed \"FreeRoam\".");
                
SetPlayerVirtualWorld(playerid0);
                
SetPlayerPos(playeridXYZ);
                
SetPlayerSkin(playeridSKIN ID);
            }
            else if(
listitem == 1)
            {
                
SendClientMessage(playerid0xFFFF00FF"You choosed \"Stunt\".");
                
SetPlayerVirtualWorld(playerid1);
                
SetPlayerPos(playeridXYZ);
                
SetPlayerSkin(playeridSKIN ID);
            }
            else if(
listitem == 2)
            {
                
SendClientMessage(playerid0xFFFF00FF"You choosed \"Drift\".");
                
SetPlayerVirtualWorld(playerid2);
                
SetPlayerPos(playeridXYZ);
                
SetPlayerSkin(playeridSKIN ID);
            }
            else if(
listitem == 3)
            {
                
SendClientMessage(playerid0xFFFF00FF"You choosed \"DM\".");
                
SetPlayerVirtualWorld(playerid3);
                
SetPlayerPos(playeridXYZ);
                
SetPlayerSkin(playeridSKIN ID);
            }
        }
    }
    return 
1;

Remark: Change "SKIN ID" for skin you want the player use and "X, Y, Z" for the position you want put player.
Reply
#10

NVM NO EROR
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)