SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 27/09/2019, 01:25 PM   #1
oRaphael
Huge Clucker
 
oRaphael's Avatar
 
Join Date: Jul 2019
Location: Goiânia, Goias.
Posts: 207
Reputation: 2
Default Fome/Sede

Como faço pra ele não poder comer mais que 100?

PHP Code:
SetPVarInt(playerid"Fome"GetPVarInt(playerid"Fome") +46); 
__________________
Fundador, Hyze RPG.
oRaphael is offline   Reply With Quote
Old 27/09/2019, 01:40 PM   #2
Delete_
High-roller
 
Delete_'s Avatar
 
Join Date: Mar 2011
Location: Gurupi - TO
Posts: 1,747
Reputation: 110
Default Re: Fome/Sede

https://wiki.sa-mp.com/wiki/Control_Structures#if
__________________
Araguaia Roleplay
Delete_ is offline   Reply With Quote
Old 28/09/2019, 04:25 AM   #3
MorteAmerica
Big Clucker
 
MorteAmerica's Avatar
 
Join Date: Feb 2015
Location: Gravatai-RS
Posts: 125
Reputation: 3
Default Re: Fome/Sede

PHP Code:
if(GetPVarInt(playerid"Fome") => 100) return SendClientMessage(playerid, -1"Você não precisa comer"); 
Está linha é para caso já esteja em 100%
PHP Code:
if(GetPVarInt(playerid"Fome") +46 => 100)
{
      
SetPVarInt(playerid"Fome"100); 
}
else
{
      
SetPVarInt(playerid"Fome"GetPVarInt(playerid"Fome") +46);

Está simplesmente verifica se somando o valor da variavel atual com a soma de 46, iguala 100 ou ultrapassa, se sim totaliza 100, se não, soma o valor pois nao chega a passar.
__________________
Trabalhos:
DisableMachines
Projetos:
Modern World
MorteAmerica is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Script Fome & Sede felipelm3g Português/Portuguese 1 03/12/2015 10:19 PM
[Ajuda] Sistemade fome e sede igor97m Português/Portuguese 5 28/12/2014 09:12 PM
[Ajuda] Sistema de Fome e Sede! Spinzor Português/Portuguese 10 23/05/2014 11:08 PM
[FilterScript] Sistema De Fome + Sede v1.0 Catchorro Lançamentos/Releases 16 03/01/2014 12:14 AM
[Pedido] Fome - Sede minimessi10 Português/Portuguese 1 07/07/2013 02:43 PM


All times are GMT. The time now is 10:28 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.