SA-MP Forums Archive
[Pedido] Divisao - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Divisao (/showthread.php?tid=536324)



Divisao - ArthurxD - 08.09.2014

Um comando para dividir o level do player em 2, pode ser simples mas tenho duvida quanto a isso.
Tentei assim:

PHP код:
Level GetPlayerScore(playerid);
Level 2
SУ QUE NEM DEU. rзrз


Re: Divisao - FallweN - 08.09.2014

pawn Код:
Level = GetPlayerScore(playerid) / 2;
Tente assim.


Re: Divisao - ArthurxD - 08.09.2014

Nem funcionou


Re: Divisao - Dolby - 08.09.2014

O cуdigo postado pelo FallweN estб correto. Poste o cуdigo todo.


Re: Divisao - ArthurxD - 08.09.2014

Nгo tem, eu queria criar mesmo kkkk


Re: Divisao - Rodney Francalim - 09.09.2014

pawn Код:
new
    n1 = 20,
    n2 = 10,
    q
;

q = n1 / n2;

printf( "%d", q );
Saнda:
Код:
2



Re: Divisao - FallweN - 09.09.2014

Tente usando variбveis do tipo float.
pawn Код:
new float:Level;

Level = GetPlayerScore(playerid) / 2;

printf("%f", Level);



Re: Divisao - ArthurxD - 09.09.2014

Vou tentar


Re: Divisao - ArthurxD - 09.09.2014

RESOLVIDO