SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/08/2019, 09:38 PM   #1
moura98
Huge Clucker
 
moura98's Avatar
 
Join Date: Jul 2015
Location: Brasil
Posts: 327
Reputation: 17
Default random se repetindo

PHP Code:
new Float:Encomendas[][3] =
{
    {
1895.2993,-2067.8494,15.6689},
    {
2328.7488,-1681.6417,14.7887},
    {
2110.9265,-1242.8789,25.7978},
    {
2186.0244,-997.8419,66.4688},
    {
1182.2992,-1076.1019,31.6719}

};
public 
OnPlayerEnterCheckpoint(playerid)
{
    if( 
cppizzaboy[playerid] == )
    {
        if( 
PizzaNaMao[playerid] == && !IsPlayerInAnyVehicle(playerid) )
        {
            new 
valorstr[50];
            
PizzaNaMao[playerid] = 0;
            
valor RandomEx(200400);
            
format(strsizeof(str), "~~> Ganhos: "Verde"R$ %i,00"valor);
            
GivePlayerMoney(playeridvalor);
            
SCM(playeridAZUL_CLARO"====| PIZZA ENTREGUE |====");
            
SCM(playerid, -1,str);
            
SCM(playeridAZUL_CLARO"==========================");
            
cppizzaboy[playerid] = 2;
                        new 
rand random(sizeof(Encomendas));
            return 
SetPlayerCheckpoint(playeridEncomendas[rand][0],Encomendas[rand][1],Encomendas[rand][2], 1); 
alguem sabe como faz pra as cordenadas nao se repetirem no random?
__________________
moura98 is offline   Reply With Quote
Old 17/08/2019, 09:47 PM   #2
Diguinho278
Little Clucker
 
Join Date: May 2019
Location: Brasil
Posts: 42
Reputation: 7
Default Re: random se repetindo

Esses dias estava com esse ''problema'' e resolvi acabei esquecendo mdss...
Aguarde alguem responder!
Diguinho278 is offline   Reply With Quote
Old 17/08/2019, 09:54 PM   #3
moura98
Huge Clucker
 
moura98's Avatar
 
Join Date: Jul 2015
Location: Brasil
Posts: 327
Reputation: 17
Default Re: random se repetindo

Quote:
Originally Posted by Diguinho278 View Post
Esses dias estava com esse ''problema'' e resolvi acabei esquecendo mdss...
Aguarde alguem responder!
mano checkpoint e uma merda de se trabalhar pqp
__________________
moura98 is offline   Reply With Quote
Old 17/08/2019, 10:03 PM   #4
Malandrin
Huge Clucker
 
Malandrin's Avatar
 
Join Date: Jun 2018
Posts: 335
Reputation: 12
Default Re: random se repetindo

Guarda o último valor do random em uma variável, quando for gerar um novo random basta verificar se o valor do random é diferente da variável, se for diferente dá continuidade ao processo caso não for você repete o processo do random.
Malandrin 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] Animação Repetindo SoldadoB Português/Portuguese 1 31/07/2019 07:10 PM
Settimer repetindo GGsamp Português/Portuguese 6 11/05/2019 06:42 PM
[Ajuda] Dialog Repetindo Texto ExPLORE Português/Portuguese 4 08/09/2014 01:38 PM
[Ajuda] Repetindo Nome Plini0M4theus Português/Portuguese 1 21/10/2012 04:01 AM
[Ajuda] SendClientMessageToAll repetindo Leo_Lost Português/Portuguese 6 05/01/2012 07:00 PM


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


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