[Projeto] Sugestхes para FilterScript (Talvez o ъltimo)
#24

Vlw pelas sugestхes pessoal, li todas, quem tiver mais posta aн por favor.

@Toddynho/AmericanStyle
Fiz aqui.
Comandos: /ComprarToddynho, /MeusToddynhos e /BeberToddynho
Code:
#include <a_samp>
#include <zcmd>
#include <DOF2>

#define PRECO_TODDYNHO 2

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("FS Toma Toddynho by Aninhaah");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	DOF2_Exit();
	return 1;
}

CMD:comprartoddynho(playerid, params[])
{
	if(isnull(params)) return SendClientMessage(playerid, -1, "Use: /ComprarToddynho [Quantidade]");
	if(GetPlayerMoney(playerid) < PRECO_TODDYNHO*strval(params)) return SendClientMessage(playerid, -1, "Vocк nгo dinheiro suficiente.");
	GivePlayerMoney(playerid, -PRECO_TODDYNHO*strval(params));
	new string[90];
	format(string, sizeof(string),"Vocк comprou %d toddynho(s). Use: /BeberToddynho.", strval(params));
	SendClientMessage(playerid, -1, string);
        new file[56], nome[MAX_PLAYER_NAME];
	GetPlayerName(playerid, nome, sizeof(nome));
	format(file, sizeof(file),"Contas/%s.ini", nome);
	if(!DOF2_FileExists(file))
	{
		DOF2_CreateFile(file);
		DOF2_SetInt(file,"QtdToddynho", strval(params));
		DOF2_SaveFile();
		return 1;
	}
	DOF2_SetInt(file,"QtdToddynho", DOF2_GetInt(file,"QtdToddynho") + strval(params));
	DOF2_SaveFile();
	return 1;
}
CMD:meustoddynhos(playerid)
{
	new file[56], nome[MAX_PLAYER_NAME];
	GetPlayerName(playerid, nome, sizeof(nome));
	format(file, sizeof(file),"Contas/%s.ini", nome);
	if(!DOF2_FileExists(file) || !DOF2_IsSet(file,"QtdToddynho") || DOF2_GetInt(file,"QtdToddynho") < 1) return SendClientMessage(playerid, -1, "Vocк nгo tem toddynho.");
	new string[90];
	format(string, sizeof(string),"Vocк tem %d toddynho(s). Use: /BeberToddynho", DOF2_GetInt(file,"QtdToddynho"));
	SendClientMessage(playerid, -1, string);
	return 1;
}
CMD:bebertoddynho(playerid)
{
        new file[56], nome[MAX_PLAYER_NAME];
	GetPlayerName(playerid, nome, sizeof(nome));
	format(file, sizeof(file),"Contas/%s.ini", nome);
	if(!DOF2_FileExists(file) || !DOF2_IsSet(file,"QtdToddynho") || DOF2_GetInt(file,"QtdToddynho") < 1) return SendClientMessage(playerid, -1, "Vocк nгo tem toddynho.");
	DOF2_SetInt(file, "QtdToddynho", DOF2_GetInt(file,"QtdToddynho")-1);
	DOF2_SaveFile();
	SendClientMessage(playerid, -1, "Vocк tomou um toddynho e ficou feliz :D");
	return 1;
}
Reply


Messages In This Thread
Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 19:53
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by Schocc - 10.10.2012, 19:56
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by zSuYaNw - 10.10.2012, 20:00
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by Life Advanced - 10.10.2012, 20:00
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 20:02
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by Schocc - 10.10.2012, 20:06
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by Schocc - 10.10.2012, 20:12
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by jpeg - 10.10.2012, 20:16
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 20:18
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by jpeg - 10.10.2012, 20:21
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 20:27
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by Schocc - 10.10.2012, 20:30
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by zSuYaNw - 10.10.2012, 20:32
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by lucaskill66 - 10.10.2012, 20:40
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 20:41
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by lucaskill66 - 10.10.2012, 20:43
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 20:45
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by AmericanStyle'™ - 10.10.2012, 20:47
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 20:50
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by Nice-.- - 10.10.2012, 20:51
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by DrTHE - 10.10.2012, 20:54
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by @Riichard - 10.10.2012, 20:55
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by lucaskill66 - 10.10.2012, 21:01
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 21:03
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by alexcordeiro - 10.10.2012, 22:03
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by zSuYaNw - 10.10.2012, 22:18
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 22:22
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by BreakDriFT - 10.10.2012, 23:25
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by zSuYaNw - 10.10.2012, 23:35
Re: Sugestхes para FilterScript (Talvez o ъltimo) - by humildadeforever - 10.10.2012, 23:39

Forum Jump:


Users browsing this thread: 1 Guest(s)