[HELP] Crash Player Problem
#1

That i need help is to get the "Crash Player" to work
When i press at "Crash Player", then nothing happends, even the SendClientMessage dont show =/

Scroll to bottom to see the "Crash Player" BTW "CrashPlayer(playerid);" comes from the #include <admin_menu>

pawn Код:
#include <a_samp>
#include <admin_menu>

new tmp[128];
new adminPlayer[20];
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    if(IsPlayerLarsey(playerid))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Teleports\nHeal Player\nGive Player Armour\nGive PlayerMoney\nSet Player Score\nCrash Player", "Select", "Cancel");

        new id = strval(tmp);
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
        adminPlayer[playerid] = clickedplayerid;
    }
    return 0;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response)
        {
            if(listitem == 0) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Where do you want to go?", "\n \n-Las Venturas Airport\n-San Fierro Airport\n-Los Santos Airport\n-Abandoned Airport\n \n-Las Venturas Bank\n-Admin HQ\n-ARMY Base\n-S.W.A.T Base\n-Regular Players Lounge\n-Derby\n-Alcatraz", "Teleport", "Cancel");
            else if(listitem == 1) return ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Heal Menu", "Enter the amount of health", "Heal", "Cancel");
            else if(listitem == 2) return ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Armour Menu", "Enter the amount of armour", "Armour", "Cancel");
            else if(listitem == 3) return ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Money Menu", "Enter the amount of money", "Money", "Cancel");
            else if(listitem == 4) return ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT, "Score Menu", "Enter the amount of score", "Score", "Cancel");
        }
    }
//Teleports---------------------------------------------------------------------
    else if(dialogid == 2)
    {
        if(response)
        {
            if(listitem == 1)
            {
                //Teleport things
            }
            else if(listitem == 2)
            {
                //Teleport things
            }
            else if(listitem == 3)
            {
                //Teleport things
            }
            else if(listitem == 4)
            {
                //Teleport things
            }
            else if(listitem == 6)
            {
                //Teleport things
            }
            else if(listitem == 7)
            {
                //Teleport things
            }
            else if(listitem == 8)
            {
                //Teleport things
            }
            else if(listitem == 9)
            {
                //Teleport things
            }
            else if(listitem == 10)
            {
                //Teleport things
            }
            else if(listitem == 11)
            {
                //Teleport things
            }
            else if(listitem == 12)
            {
                //Teleport things
            }
        } else return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Teleports\nHeal Player\nGive Player Armour\nGive Player Money\nSet Player Score\nCrash Player", "Select", "Cancel");
    }
//Heal Player-------------------------------------------------------------------
    else if(dialogid == 3)
    {
        if(response)
  {
   if(!IsNumeric(inputtext)) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You must enter a number!");
            else {
                //Heal Thing Here
                adminPlayer[playerid] = -1;
            }
        } else return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Teleports\nHeal Player\nGive Player Armour\nGive Player Money\nSet Player Score\nCrash Player", "Select", "Cancel");
    }
//Give Player Armour------------------------------------------------------------
    else if(dialogid == 4)
    {
        if(response)
        {
            if(!IsNumeric(inputtext)) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You must enter a number!");
            else {
                //Armour Thing Here
                adminPlayer[playerid] = -1;
            }
        } else return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Teleports\nHeal Player\nGive Player Armour\nGive Player Money\nSet Player Score\nCrash Player", "Select", "Cancel");
    }
//Give Player Money-------------------------------------------------------------
    else if(dialogid == 5)
    {
        if(response)
        {
            if(!IsNumeric(inputtext)) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You must enter a number!");
            else {
                //Money Thing Here
                adminPlayer[playerid] = -1;
            }
        } else return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Teleports\nHeal Player\nGive Player Armour\nGive Player Money\nSet Player Score\nCrash Player", "Select", "Cancel");
    }
//Set Player Score--------------------------------------------------------------
    else if(dialogid == 6)
    {
        if(response)
        {
            if(!IsNumeric(inputtext)) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You must enter a number!");
            else {
                //Score Thing Here
                adminPlayer[playerid] = -1;
            }
        } else return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Teleports\nHeal Player\nGive Player Armour\nGive Player Money\nSet Player Score\nCrash Player", "Select", "Cancel");
    }
//Crash Player------------------------------------------------------------------
    else if(dialogid == 7)
    {
        if(response)
        {
            CrashPlayer(playerid);
            SendClientMessage(playerid,COLOR_RED,"You crashed that poor kid!");
        } else return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Teleports\nHeal Player\nGive Player Armour\nGive Player Money\nSet Player Score\nCrash Player", "Select", "Cancel");
    }
    return 1;
}
Thanks to Webghost and famas.[FTW] who have helped me alot with this
Reply
#2

pawn Код:
if(IsPlayerLarsey(playerid))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Teleports\nHeal Player\nGive Player Armour\nGive PlayerMoney\nSet Player Score\nCrash Player", "Select", "Cancel");

        new id = strval(tmp);
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
        adminPlayer[playerid] = clickedplayerid;
    }
You're not giving them the option in dialog ID 1 to get to ID 7. By the way, from what I skimmed through on your code, you'll end up crashing yourself.
Reply
#3

Still dont work =/
Reply
#4

CrashPlayer(adminPlayer[playerid]);

Dunno will that works.
Reply
#5

Quote:
Originally Posted by Basicz
Посмотреть сообщение
CrashPlayer(adminPlayer[playerid]);

Dunno will that works.
I know that will work, but when i click at "Crash Player" it is like it don have an function
Reply
#6

Evrything else work, but not the "Crash Player" I have tried 100 times to get it to work but i get the same resultat, "When i click at Crash Player, Nothing happends" =/
Reply
#7

hm... have you checked on the wiki ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)