03.12.2015, 20:20
Baixei esse Script de Fome e Sede, fiz algumas alteraзхes....
Gostaria de poder salvar os dados da progressbar pra quando o cara relogar continuar a barra de onde parou!
Segue Script
.
Gostaria de poder salvar os dados da progressbar pra quando o cara relogar continuar a barra de onde parou!
Segue Script
.
Quote:
//================================================== ==========================// // FilterScript De Fome e Sede Criado Por Catchorro , Nao Retirar Os Creditos // //================================================== ==========================// #include <progress> #include <a_samp> #include <zcmd> //================================================== ==========================// #define FomeTempo 1 // Tempo Da Fome Ex : 1 Minuto #define SedeTempo 1 // Tempo Da Sede Ex : 1 Minuto //================================================== ==========================// #define Positivo 0xFFFF00FF #define Negativo 0xAA3333AA //================================================== ==========================// new Text:FomeT; new Text:SedeT; //================================================== ==========================// new Bar:FomeA; new Bar:SedeB; //================================================== ==========================// forward Fome(playerid); forward Sede(playerid); //================================================== ==========================// public OnFilterScriptInit() { //================================================== ==========================// FomeT = TextDrawCreate(528.000000, 384.000000, "Fome"); TextDrawBackgroundColor(FomeT, 0x000000FF); TextDrawFont(FomeT, 2); TextDrawLetterSize(FomeT, 0.310000, 1.100000); TextDrawColor(FomeT, 0xFFFFFFFF); TextDrawSetOutline(FomeT, 1); TextDrawSetProportional(FomeT, 1); //================================================== ==========================// SedeT = TextDrawCreate(528.000000, 396.000000, "Sede"); TextDrawBackgroundColor(SedeT, 0x000000FF); TextDrawFont(SedeT, 2); TextDrawLetterSize(SedeT, 0.320000, 1.100000); TextDrawColor(SedeT, 0xFFFFFFFF); TextDrawSetOutline(SedeT, 1); TextDrawSetProportional(SedeT, 1); //================================================== ==========================// FomeA = CreateProgressBar(570.00, 388.00, 55.50, 3.20, 0x00D900C8, 100.0); SetProgressBarMaxValue(FomeA, 100); SedeB = CreateProgressBar(570.00, 400.00, 55.50, 3.20, 0x33CCFFAA, 100.0); SetProgressBarMaxValue(SedeB, 100); //================================================== ==========================// return 1; } //================================================== ==========================// public OnFilterScriptExit() { //================================================== ==========================// HideProgressBarForAll(FomeA); HideProgressBarForAll(SedeB); //================================================== ==========================// TextDrawDestroy(FomeT); TextDrawDestroy(SedeT); //================================================== ==========================// return 1; } //================================================== ==========================// public OnPlayerConnect(playerid) { //================================================== ==========================// //Funзгo //================================================== ==========================// return 1; } //================================================== ==========================// public OnPlayerSpawn(playerid) { //================================================== ==========================// SetPVarInt(playerid,"Fome",100); ShowProgressBarForPlayer(playerid, FomeA); SetProgressBarValue(FomeA,100); UpdateProgressBar(FomeA,playerid); SetPVarInt(playerid,"Sede",100); ShowProgressBarForPlayer(playerid, SedeB); SetProgressBarValue(SedeB,100); UpdateProgressBar(SedeB,playerid); //================================================== ==========================// TextDrawShowForPlayer(playerid, FomeT); TextDrawShowForPlayer(playerid, SedeT); //================================================== ==========================// SetTimerEx("Fome",FomeTempo*60000 , 1, "i", playerid); SetTimerEx("Sede",SedeTempo*60000 , 1, "i", playerid); //================================================== ==========================// return 1; } //================================================== ==========================// public OnPlayerDeath(playerid, killerid, reason) { //================================================== ==========================// SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Se de")+20); SetProgressBarValue(SedeB, GetPVarInt(playerid,"Sede")); UpdateProgressBar(SedeB,playerid); SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fo me")+20); SetProgressBarValue(FomeA, GetPVarInt(playerid,"Fome")); UpdateProgressBar(FomeA,playerid); //================================================== ==========================// return 1; } //================================================== ==========================// public Fome(playerid) { //================================================== ==========================// SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fo me")-2); SetProgressBarValue(FomeA, GetPVarInt(playerid,"Fome")); UpdateProgressBar(FomeA,playerid); if(GetPVarInt(playerid,"Fome") <= 5) { new Float:Vida; GetPlayerHealth(playerid,Vida),SetPlayerHealth(pla yerid,Vida-70.0); SendClientMessage(playerid,-1,"{AA3333}Vocк precisa Comer ou morrerб."); } //================================================== ==========================// return 1; } //================================================== ==========================// public Sede(playerid) { //================================================== ==========================// SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Se de")-5); SetProgressBarValue(SedeB, GetPVarInt(playerid,"Sede")); UpdateProgressBar(SedeB,playerid); if(GetPVarInt(playerid,"Sede") <= 5) { new Float:Vida; GetPlayerHealth(playerid,Vida),SetPlayerHealth(pla yerid,Vida-70.0); SendClientMessage(playerid,-1,"{AA3333}Vocк precisa Beber ou morrerб."); } //================================================== ==========================// return 1; } //================================================== ==========================// CMD:comer(playerid,params[]) { SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fo me")+95); SetProgressBarValue(FomeA, GetPVarInt(playerid,"Fome")); UpdateProgressBar(FomeA,playerid); SetPlayerHealth(playerid, 100); ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.1, 0, 0, 0, 0, 0, 1); SendClientMessage(playerid,-1,"{FFFF00}Voce comeu e sua fome diminuiu."); return 1; } //================================================== ==========================// CMD:beber(playerid,params[]) { SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Se de")+95); SetProgressBarValue(SedeB, GetPVarInt(playerid,"Sede")); UpdateProgressBar(SedeB,playerid); SetPlayerHealth(playerid, 100); ApplyAnimation(playerid,"VENDING","VEND_Drink_P", 4.1, 0, 0, 0, 0, 0, 1); SendClientMessage(playerid,-1,"{FFFF00}Voce bebeu e sua sede diminuiu."); return 1; } //================================================== ==========================// // FilterScript De Fome e Sede Criado Por Catchorro , Nao Retirar Os Creditos // //================================================== ==========================// |