Help for my commande
#1

Hello, I created a control with OnPlayerCommandText and OnDialogResponse but when I canceled it will have one message "Server is Closed" Or when I chose something from the menu such as a "Sultan" the password of the player changes. Please help me
Reply
#2

Show some lines.
Reply
#3

This is my commande for menu
Quote:

if (strcmp(cmdtext,"/va",true) ==0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Adm in cars","1. Sultan\r\n2. NRG\r\n3. Infernus\r\n4. Buffalo","Valider", "Annuler");
return 1;
}

This is the reponse

Quote:

switch(dialogid) // Lookup the dialogid
{
case 1:
{
switch(listitem) // This is far more efficient than using an if-elseif-else structure
{
case 0: // Listitems start with 0, not 1
{
new Float:X,Float:Y,Float:Z,Float:Angle;
new veh;
GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle);
veh = CreateVehicle(560,X,Y,Z,Angle,158,1,-0);
PutPlayerInVehicle(playerid,veh, 0);
}
case 1:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
new veh;
GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle);
veh = CreateVehicle(522,X,Y,Z,Angle,158,1,-0);
PutPlayerInVehicle(playerid,veh, 0);
}
case 2:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
new veh;
GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle);
veh = CreateVehicle(411,X,Y,Z,Angle,158,1,-0);
PutPlayerInVehicle(playerid,veh, 0);
}
case 3:
{
new Float:X,Float:Y,Float:Z,Float:Angle;
new veh;
GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle);
veh = CreateVehicle(402,X,Y,Z,Angle,158,1,-0);
PutPlayerInVehicle(playerid,veh, 0);
}
// Add the rest of your listitems for dialog 1 here

}

}
// Add the rest of your dialogs here

}

Reply
#4

pawn Код:
switch(dialogid) // Lookup the dialogid
{
    case 1:
    {
        if(response)
        {
            switch(listitem) // This is far more efficient than using an if-elseif-else structure
            {
                case 0: // Listitems start with 0, not 1
Reply
#5

Thinkx varthshenon
But the password always changing.
Reply
#6

What password?
Reply
#7

Heres my vehicle dialog from my blank gamemode I made.
pawn Код:
if(dialogid == DIALOG_VEHICLES)
{
new Float:x,Float:y,Float:z;
if(response == 1)// They pressed the first button.
{
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// Elegy - First item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(562,x+3.0,y,z,0,-1,-1,5);
                   
                }
                case 1: //Sultan - Second Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(560,x+3.0,y,z,0,-1,-1,5);
                }
                case 2://Infernus - Third Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(411,x+3.0,y,z,0,-1,-1,5);
                }
                case 3://Turismo - Fourth Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(451,x+3.0,y,z,0,-1,-1,5);
                }
                case 4://Hotring - Fifth Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(494,x+3.0,y,z,0,-1,-1,5);
                }
                case 5://Hotring A - Sixth Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(502,x+3.0,y,z,0,-1,-1,5);
                }
                case 6://Hotring B - Seventh Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(503,x+3.0,y,z,0,-1,-1,5);
                }
                case 7://NRG - Eigth Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(522,x+3.0,y,z,0,-1,-1,5);
                }
               
       
            }
}
}
Reply
#8

Quote:
Originally Posted by Azzeto
Посмотреть сообщение
Heres my vehicle dialog from my blank gamemode I made.
pawn Код:
if(dialogid == DIALOG_VEHICLES)
{
new Float:x,Float:y,Float:z;
if(response == 1)// They pressed the first button.
{
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// Elegy - First item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(562,x+3.0,y,z,0,-1,-1,5);
                   
                }
                case 1: //Sultan - Second Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(560,x+3.0,y,z,0,-1,-1,5);
                }
                case 2://Infernus - Third Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(411,x+3.0,y,z,0,-1,-1,5);
                }
                case 3://Turismo - Fourth Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(451,x+3.0,y,z,0,-1,-1,5);
                }
                case 4://Hotring - Fifth Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(494,x+3.0,y,z,0,-1,-1,5);
                }
                case 5://Hotring A - Sixth Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(502,x+3.0,y,z,0,-1,-1,5);
                }
                case 6://Hotring B - Seventh Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(503,x+3.0,y,z,0,-1,-1,5);
                }
                case 7://NRG - Eigth Item in the Dialog
                {
                    GetPlayerPos(playerid,x,y,z);
                    CreateVehicle(522,x+3.0,y,z,0,-1,-1,5);
                }
               
       
            }
}
}
I don't see any difference between his code and your code. Your code just more simple.
Reply
#9

He said he was having bugs with his, My code has no bugs, (but it doesnt put them in the vehicle, spawns the vehicle next to them) and I know for sure it doesn't change the server/player password
Reply
#10

Thinks all
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)