SA-MP Forums Archive
Help me with dialog - 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 me with dialog (/showthread.php?tid=566826)



Delete this - RedCode - 08.03.2015

Deleted


Re: Help me with dialog - biker122 - 08.03.2015

Here you go:
pawn Код:
#define viplocker_dialog        1990

CMD:viplocker(playerid, params[])
{
        if(CanUseLocker[playerid]==false) return SendClientMessage(playerid, COLOR_WHITE, "You have to wait before using locker again.");
    if(PlayerInfo[playerid][pDonator] >= 1)
    {
        if(IsPlayerInRangeOfPoint(playerid,3,-2653.1226, 1410.2570 ,906.2734))
        {
            ShowPlayerDialogEx(playerid, viplocker_dialog, DIALOG_STYLE_LIST, "VIP Locker", "Health\nArmour\nDeagle", "Select", "Cancel");
                         VipLockerTimer[playerid] = SetTimerEx("VipLockerTime", 3600*1000, false, "i", playerid);
                         CanUseLocker[playerid] = false;
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You arent in correct place.");
        }
    }
    return 1;
}

forward VipLockerTime(playerid);
public VipLockerTime(playerid)
{
       CanUseLocker[playerid] = true;
       return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == viplocker_dialog)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerHealth(playerid, 100.0);
                SendClientMessage(playerid, 0xFFFFFF, "You have bought health!");
            }
            if(listitem == 1)
            {
                SetPlayerArmour(playerid, 100.0);
                SendClientMessage(playerid, 0xFFFFFF, "You have bought armour!");
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 24, 500);
                SendClientMessage(playerid, 0xFFFFFF, "You have bought a Desert Eagle!");
            }
        }
    }
    return 1;
}



Re: Help me with dialog - MrCallum - 08.03.2015

Код:
#define viplocker_dialog		1990

CMD:viplocker(playerid, params[])
{
        if(CanUseLocker[playerid]==false) return SendClientMessage(playerid, COLOR_WHITE, "You have to wait before using locker again.");
	if(PlayerInfo[playerid][pDonator] >= 1)
	{
		if(IsPlayerInRangeOfPoint(playerid,3,-2653.1226, 1410.2570 ,906.2734))
		{
			ShowPlayerDialogEx(playerid, viplocker_dialog, DIALOG_STYLE_LIST, "VIP Locker", "Health\nArmour\nDeagle", "Select", "Cancel");
                         VipLockerTimer[playerid] = SetTimerEx("VipLockerTime", 3600*1000, false, "i", playerid);
                         CanUseLocker[playerid] = false;
		}
		else
		{
			SendClientMessage(playerid, COLOR_WHITE, "You are not in the correct place.");
		}
	}
	return 1;
}

forward VipLockerTime(playerid);
public VipLockerTime(playerid)
{
       CanUseLocker[playerid] = true;
       return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == viplocker_dialog)
	{
		if(response)
		{
			if(listitem == 0)
			{
				SetPlayerHealth(playerid, 100.0);
				SendClientMessage(playerid, COLOR_WHITE, "You have bought your way up to 100% health!");
                                GivePlayerMoney(playerid, -300);
			}
			if(listitem == 1)
			{
				SetPlayerArmour(playerid, 100.0);
				SendClientMessage(playerid, COLOR_WHITE, "You have bought your armor up to 100% health!");
                                GivePlayerMoney(playerid, -300);
			}
			if(listitem == 2)
			{
				GivePlayerWeapon(playerid, 24, 500);
				SendClientMessage(playerid, COLOR_YELLOW, "You have bought a Desert Eagle for yourself!");
                                GivePlayerMoney(playerid, -1300);
			}
		}
	}
	return 1;
}



Re: Help me with dialog - biker122 - 08.03.2015

Quote:
Originally Posted by MrCallum
Посмотреть сообщение
Код:
#define viplocker_dialog		1990

CMD:viplocker(playerid, params[])
{
        if(CanUseLocker[playerid]==false) return SendClientMessage(playerid, COLOR_WHITE, "You have to wait before using locker again.");
	if(PlayerInfo[playerid][pDonator] >= 1)
	{
		if(IsPlayerInRangeOfPoint(playerid,3,-2653.1226, 1410.2570 ,906.2734))
		{
			ShowPlayerDialogEx(playerid, viplocker_dialog, DIALOG_STYLE_LIST, "VIP Locker", "Health\nArmour\nDeagle", "Select", "Cancel");
                         VipLockerTimer[playerid] = SetTimerEx("VipLockerTime", 3600*1000, false, "i", playerid);
                         CanUseLocker[playerid] = false;
		}
		else
		{
			SendClientMessage(playerid, COLOR_WHITE, "You are not in the correct place.");
		}
	}
	return 1;
}

forward VipLockerTime(playerid);
public VipLockerTime(playerid)
{
       CanUseLocker[playerid] = true;
       return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == viplocker_dialog)
	{
		if(response)
		{
			if(listitem == 0)
			{
				SetPlayerHealth(playerid, 100.0);
				SendClientMessage(playerid, COLOR_WHITE, "You have bought your way up to 100% health!");
                                GivePlayerMoney(playerid, -300);
			}
			if(listitem == 1)
			{
				SetPlayerArmour(playerid, 100.0);
				SendClientMessage(playerid, COLOR_WHITE, "You have bought your armor up to 100% health!");
                                GivePlayerMoney(playerid, -300);
			}
			if(listitem == 2)
			{
				GivePlayerWeapon(playerid, 24, 500);
				SendClientMessage(playerid, COLOR_YELLOW, "You have bought a Desert Eagle for yourself!");
                                GivePlayerMoney(playerid, -1300);
			}
		}
	}
	return 1;
}
Stop copying shit from my post.. Can't you do of your own?


Re: Help me with dialog - Ryan25 - 08.03.2015

pawn Код:
#include <a_samp>
#define COLOR_WHITE 0xFFFFFFAA
#define VIPWEPSMENU 1990
#pragma tabsize 0
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[128];
    if(dialogid == VIPWEPSMENU)
    {
        if(response)
        {
            if(listitem == 0)
            {
                format(string, sizeof(string), "Successfully healed.");
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    SetPlayerHealth(playerid, 100);
                        }
                if(listitem == 1)
            {
                format(string, sizeof(string), "Successfully bought a Kevlar Vest.");
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    SetPlayerArmour(playerid, 100.0);
                    }
                if(listitem == 2)
            {
                format(string, sizeof(string), "Successfully bought a Deagle.");
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    GivePlayerWeapon(playerid, 24, 999);
                    }
                   
                         }
return 1;
}
return 0;
}



Re: Help me with dialog - MrCallum - 08.03.2015

@Biker, I did not copy your code since I was working on it at the time you posted yours, mine got delayed due to my own script having errors...


Re: Help me with dialog - biker122 - 08.03.2015

- Removed -
There's no use in arguing with stupid fuckers.


Re: Help me with dialog - MrCallum - 08.03.2015

Is that a problem? Most people use the same style, for example; Project:Los Angeles copied Next Generation Gaming's style....


Re: Help me with dialog - Ryan25 - 08.03.2015

Quote:
Originally Posted by RedCode
Посмотреть сообщение
Hi guys , one guy helped me to create cmd with timer but i have a problem

Here the code :
Код:
new VipLockerTimer[MAX_PLAYERS],  
               bool:CanUseLocker[MAX_PLAYERS];

OnPlayerConnect(playerid)
CanUseLocker[playerid] = true;
Код:
CMD:viplocker(playerid, params[])
{
        if(CanUseLocker[playerid]==false) return SendClientMessage(playerid, COLOR_WHITE, "You have to wait before using locker again.");
	if(PlayerInfo[playerid][pDonator] >= 1)
	{
		if(IsPlayerInRangeOfPoint(playerid,3,-2653.1226, 1410.2570 ,906.2734))
		{
			ShowPlayerDialogEx(playerid, viplocker, DIALOG_STYLE_LIST, "VIP Locker", "Health\nArmour\nDeagle", "Select", "Cancel");
                         VipLockerTimer[playerid] = SetTimerEx("VipLockerTime", 3600*1000, false, "i", playerid);
                         CanUseLocker[playerid] = false;
		}
		else
		{
			SendClientMessage(playerid, COLOR_WHITE, "You arent in correct place.");
		}
	}
	return 1;
}

forward VipLockerTime(playerid);
public VipLockerTime(playerid)
{
       CanUseLocker[playerid] = true;
       return 1;
}
Who can make for me OnDialogResponse to buy 1.Health , 2.Armour . 3.Deagle ?

#define VIPWEPSMENU 1990

+REP
Tested it?


Re: Help me with dialog - RedCode - 08.03.2015

Yeah thanks guys , but i have another problem , check my new thread !