Credits System
#4

#1
use
Код:
enum
{
DIALOG_HOWEVER_YOU_CALL_IT,// DIALOG_HOWEVER_YOU_CALL_IT = 500, <- if u write it like this, it will count from 500 up to the limit
DIALOG_CREDIT1_CONFIRM
}
reason? It's like autoincrement.

#2
Код:
CMD:Buycredit..
{
//actually you dont need params here
#pragma unused params
ShowPlayerDialog(playerid,DIALOG_HOWEVER_YOU_CALL_IT,DIALOG_STYLE_LIST," Credits","1 Credit\n2 Credits\n..","Ok","Nope");
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
		case DIALOG_HOWEVER_YOU_CALL_IT:
		{
			if(!response)return 1;
			switch(listitem)
				{
				case 0://1 credit
				{
					ShowPlayerDialog(playerid,DIALOG_CREDIT1_CONFIRM,DIALOG_STYLE_MSGBOX,"Credit #1","Buy 1 Credit for 1.000.000.","Confirm","Nope");
				}
				case 1://2 credit
				{
					//same ^
				}
			}
		}
		case DIALOG_CREDIT1_CONFIRM:
		{
		    if(!response)return SendClientMessage(playerid,-1," You disagreed");
			GivePlayerMoney(playerid,GetPlayerMoney(playerid) -100000);
			new i,string[60];
			format(string,sizeof(string)," %s bought 1 Credit.",NameStuff);
			for(i;<MAX_PLAYERS;i++)
			{
			    if(!IsPlayerConnected(i))continue;
			    if(!YourAdminStuff(i))continue;
				SendClientMessage(i,-1,string);
			}
		}
	}
	return 1;
}
Of course you will have to fix the code, so that it works for your system
Reply


Messages In This Thread
Credits System please help - by MrCallum - 17.08.2014, 19:35
Re: Credits System - by MrCallum - 17.08.2014, 22:19
Re: Credits System - by Threshold - 17.08.2014, 23:08
AW: Credits System - by yellow - 17.08.2014, 23:11

Forum Jump:


Users browsing this thread: 1 Guest(s)