SA-MP Forums Archive
FireFighter - 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: FireFighter (/showthread.php?tid=360793)



FireFighter - Riper97 - 18.07.2012

Okay i started scripting this and there is a problem in OnDialogResponse :/

when i write /ffighter it gives Unknown Command and then it gives FireFighter Job and gives dialog but response is not working

i got another script Similar it is a GunShop but that works


The Code :/
Код:
#pragma tabsize 0

#include <a_samp>
#include <zcmd>

#define FILTERSCRIPT

#define COLOR_LIME   0x00FF00FF
#define COLOR_RED    0xFF0000FF
#define COLOR_CYAN   0x00FFFFFF
#define COLOR_ORANGE 0xFFA500FF

#define FIREFIGHTER_DIALOG 21

CMD:firefighter(playerid, params[])
{
SendClientMessage(playerid,COLOR_RED,"FireFighter Job");
ShowPlayerDialog(playerid,FIREFIGHTER_DIALOG, DIALOG_STYLE_LIST, "FireFighters!", " Fighter No.1\n Fighter No.2\n Fighter No.3","Set","Cancel");
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 21)
{
if(listitem == 0)
{
GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 277);
}
if(listitem == 1)
{
GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 278);
}
if(listitem == 2)
{
GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 279);
}
}
return 1;
}



Re: FireFighter - [MM]18240[FMB] - 18.07.2012

Quote:
Originally Posted by Riper97
Посмотреть сообщение
Okay i started scripting this and there is a problem in OnDialogResponse :/

when i write /ffighter it gives Unknown Command and then it gives FireFighter Job and gives dialog but response is not working

pawn Код:
CMD:firefighter(playerid, params[])
Try using /firefighter Instead of /ffighter


Re : FireFighter - lelemaster - 19.07.2012

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 21)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 277);
            }
            if(listitem == 1)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 278);
            }
            if(listitem == 2)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 279);
            }
        }
    }
    return 1;
}
pawn Код:
CMD:firefighter(playerid, params[])
{
    SendClientMessage(playerid,COLOR_RED,"FireFighter Job");
    ShowPlayerDialog(playerid,FIREFIGHTER_DIALOG, DIALOG_STYLE_LIST, "FireFighters!", " Fighter No.1\n Fighter No.2\n Fighter No.3","Set","Cancel");
    return 1;
}



Re: FireFighter - [A]ndrei - 19.07.2012

EDIT: Guy Above beat me to the chase
pawn Код:
blic OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 21)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 277);
            }
            if(listitem == 1)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 278);
            }
            if(listitem == 2)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 279);
            }
        }
    }
    return 1;
}



Re : Re: FireFighter - lelemaster - 19.07.2012

Quote:
Originally Posted by [A]ndrei
Посмотреть сообщение
EDIT: Guy Above beat me to the chase
I knew someone would post, so I posted the strick minimum, then I edited the full codes.


Re: FireFighter - Riper97 - 19.07.2012

Quote:
Originally Posted by [MM]18240[FMB]
Посмотреть сообщение
Try using /firefighter Instead of /ffighter
That Wouldn't change anything


Re: Re : FireFighter - Riper97 - 19.07.2012

Quote:
Originally Posted by lelemaster
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 21)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 277);
            }
            if(listitem == 1)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 278);
            }
            if(listitem == 2)
            {
                GetPlayerSkin(playerid);
                SetPlayerSkin(playerid, 279);
            }
        }
    }
    return 1;
}
pawn Код:
CMD:firefighter(playerid, params[])
{
    SendClientMessage(playerid,COLOR_RED,"FireFighter Job");
    ShowPlayerDialog(playerid,FIREFIGHTER_DIALOG, DIALOG_STYLE_LIST, "FireFighters!", " Fighter No.1\n Fighter No.2\n Fighter No.3","Set","Cancel");
    return 1;
}
Thanks For Your Help And Thanks To Everyone that replied


Re: FireFighter - Riper97 - 19.07.2012

NO NO NO STILL THE SAME PROBLEM IT DOESN"T CHANGE THE SKIN


Re: FireFighter - leonardo1434 - 19.07.2012

its not necessary get the player's skin to set it, this should work. if this it's not working, there is something interfering.

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

#define FILTERSCRIPT
#define COLOR_LIME   0x00FF00FF
#define COLOR_RED    0xFF0000FF
#define COLOR_CYAN   0x00FFFFFF
#define COLOR_ORANGE 0xFFA500FF

#define FIREFIGHTER_DIALOG 21

CMD:firefighter(playerid, params[])
{
    SendClientMessage(playerid,COLOR_RED,"FireFighter Job");
    return ShowPlayerDialog(playerid,FIREFIGHTER_DIALOG, DIALOG_STYLE_LIST, "FireFighters!", "Fighter No.1\nFighter No.2\nFighterNo.3","Set","Cancel");
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == FIREFIGHTER_DIALOG) {
        if(listitem == 0) {
            return SetPlayerSkin(playerid, 277);
        }
        if(listitem == 1) {
            return SetPlayerSkin(playerid, 278);
        }
        if(listitem == 2) {
            return SetPlayerSkin(playerid, 279);
        }
    }
    return 1;
}



Re: FireFighter - Riper97 - 19.07.2012

No still doesn't work.
I have tried with Switch , If , without zcmd no no no

only thing that works was putting it like this
CMD:SHIT(playerid, params[])
{
SetPlayerSkin(playerid, 279);
}
THA DA