SA-MP Forums Archive
Help for my commande - 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: Help for my commande (/showthread.php?tid=278562)



Help for my commande - Lhine.S - 22.08.2011

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


Re: Help for my commande - =WoR=G4M3Ov3r - 22.08.2011

Show some lines.


Re : Help for my commande - Lhine.S - 22.08.2011

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

}




Re: Help for my commande - =WoR=Varth - 23.08.2011

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



Re : Help for my commande - Lhine.S - 23.08.2011

Thinkx varthshenon
But the password always changing.


Re: Help for my commande - =WoR=Varth - 24.08.2011

What password?


Re: Help for my commande - Azzeto - 24.08.2011

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);
                }
               
       
            }
}
}



Re: Help for my commande - =WoR=Varth - 24.08.2011

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.


Re: Help for my commande - Azzeto - 24.08.2011

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


Re : Help for my commande - Lhine.S - 25.08.2011

Thinks all