SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese > Lançamentos/Releases

Reply
 
Thread Tools Display Modes
Old 09/12/2012, 03:31 PM   #11
VenoN
Gangsta
 
VenoN's Avatar
 
Join Date: Aug 2012
Location: California
Posts: 701
Reputation: 53
Default Re: Sistema de Surpresas 1.0

legalzin cara

agora que foi desbanido pense 2 vezes antes de fazer merda né :d

+Rep
__________________
Skype: paulo_pilastre3

VenoN is offline   Reply With Quote
Old 09/12/2012, 03:32 PM   #12
Ouro
Huge Clucker
 
Ouro's Avatar
 
Join Date: Sep 2012
Posts: 329
Reputation: 15
Default Re: Sistema de Surpresas 1.0

Quote:
Originally Posted by D4rk View Post
mesmo assim o certo é 128
http://forum.sa-mp.com/showpost.php?...4&postcount=26
Ouro is offline   Reply With Quote
Old 09/12/2012, 04:09 PM   #13
[NVC]iTrevaS
High-roller
 
[NVC]iTrevaS's Avatar
 
Join Date: Jan 2012
Location: Paraguay - P.J.C
Posts: 1,038
Reputation: 50
Default Respuesta: Sistema de Surpresas 1.0

é, Até que ficou bom, tinha visto esse sistema em um sevidor, um evento nesse servidor chamado 'Surpresas de Natal' que existe vários premios espalhados por San Andreas igualzinho do teu, você ja deve saber que servidor é esse.
[NVC]iTrevaS is offline   Reply With Quote
Old 09/12/2012, 05:27 PM   #14
Schocc
High-roller
 
Join Date: Mar 2012
Location: /home
Posts: 3,239
Reputation: 378
Default Re: Sistema de Surpresas 1.0

Poderia ter usado uma nova callback em vez de OnPlayerUpdate

@edit legual seu sistema ^^

Ja que não postou no pastebin eu faço as honras
pawn Code:
#include <a_Samp>
#include <Zcmd>
#include <DOF2>

#define Score 10
#define Money 100000

#define Surpresas "Surpresas/%s.ini"

new Nome[25];
new Fala[129];

new Surpresa[500];
new TimerSurprise[500];

stock SetPlayerSurprises(playerid,level)
{
    Surpresa[playerid] = level;
    return 1;
}
stock GetPlayerSurprises(playerid)
{
    return Surpresa[playerid];
}

CMD:surpresas(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,1480.0,-1640.0,14.0))
    {
        if(GetPlayerSurprises(playerid) == 0)
        {
            GetPlayerName(playerid,Nome,sizeof(Nome));
            format(Fala,sizeof(Fala),"%s adquiriu uma Surpresa! Para adquirir, vá até o '$' no mapa.",Nome);
            SendClientMessageToAll(0xFF8080AA,Fala);
            SetPlayerScore(playerid,GetPlayerScore(playerid)+random(Score));
            GivePlayerMoney(playerid,random(Money));
            SetPlayerSurprises(playerid,60);
            TimerSurprise[playerid] = SetTimerEx("ResetPlayerSurprises",60000,1,"i",playerid);
            return 1;
        }
        else
        {
            SendClientMessage(playerid,0xBFBFBFAA,"Para adquirir outra Surpresa, espere uma Hora.");
            return 1;
        }
    }
    return 1;
}

public OnFilterScriptInit()
{
    AddStaticPickup(1274,1,1480.0,-1640.0,14.0,0);
    Create3DTextLabel("Surpresas\nTecle F e adquira a sua",0xFF8080AA,1480.0,-1640.0,14.0,10.0,0,0);
    return 1;
}

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

public OnPlayerConnect(playerid)
{
    SetPlayerMapIcon(playerid,54,1480.0,-1640.0,14.0,52,0,1);

    GetPlayerName(playerid,Nome,sizeof(Nome));
    format(Fala,sizeof(Fala),Surpresas,Nome);

    if(DOF2_FileExists(Fala))
    {
        SetPlayerSurprises(playerid,DOF2_GetInt(Fala,"Tempo"));
        TimerSurprise[playerid] = SetTimerEx("ResetPlayerSurprises",DOF2_GetInt(Fala,"Tempo"),1,"i",playerid);
    }
    return 1;
}

public OnPlayerDisconnect(playerid,reason)
{
    if(GetPlayerSurprises(playerid) == 1)
    {
        GetPlayerName(playerid,Nome,sizeof(Nome));
        format(Fala,sizeof(Fala),Surpresas,Nome);
       
        if(!DOF2_FileExists(Fala))
        {
            DOF2_CreateFile(Fala);
            DOF2_SetInt(Fala,"Tempo",GetPlayerSurprises(playerid));
            DOF2_SaveFile();
            return 1;
        }
        else
        {
            DOF2_SetInt(Fala,"Tempo",GetPlayerSurprises(playerid));
            return 1;
        }
    }
    return 1;
}

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if(newkeys == 16)
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            cmd_surpresas(playerid,"");
            return 1;
        }
    }
    return 1;
}

public OnPlayerUpdate(playerid)
{
    GetPlayerName(playerid,Nome,sizeof(Nome));
    format(Fala,sizeof(Fala),Surpresas,Nome);
   
    if(DOF2_FileExists(Fala))
    {
        DOF2_SetInt(Fala,"Tempo",GetPlayerSurprises(playerid));
        DOF2_SaveFile();
    }
    else
    {
        if(GetPlayerSurprises(playerid) >= 1)
        {
            DOF2_CreateFile(Fala);
            DOF2_SetInt(Fala,"Tempo",GetPlayerSurprises(playerid));
            DOF2_SaveFile();
        }
    }
    return 1;
}

forward ResetPlayerSurprises(playerid);

public ResetPlayerSurprises(playerid)
{
    SetPlayerSurprises(playerid,GetPlayerSurprises(playerid)-1);
    if(GetPlayerSurprises(playerid) == 0)
    {
        KillTimer(TimerSurprise[playerid]);
        SendClientMessage(playerid,0xBFBFBFAA,"Adquira sua surpresa novamente! Vá até o '$' no mapa.");
    }
    return 1;
}
Schocc is offline   Reply With Quote
Old 09/12/2012, 06:23 PM   #15
JapaN*
Huge Clucker
 
JapaN*'s Avatar
 
Join Date: Aug 2012
Location: Andrômeda Galaxy User Type: Scripter
Posts: 338
Reputation: 12
Default Re: Sistema de Surpresas 1.0

Pastebin!
JapaN* is offline   Reply With Quote
Old 09/12/2012, 07:55 PM   #16
BielCOP
Banned
 
Join Date: Nov 2012
Location: Estado de SP
Posts: 1,124
Reputation: -8
Default Re: Sistema de Surpresas 1.0

vlws Gente. muito OBG
BielCOP is offline   Reply With Quote
Old 09/12/2012, 08:54 PM   #17
RebeloX
High-roller
 
RebeloX's Avatar
 
Join Date: Jul 2011
Location: Portugal
Posts: 2,172
Reputation: 442
Default Re: Sistema de Surpresas 1.0

Gostei, bom trabalho
__________________
RebeloX is offline   Reply With Quote
Old 09/12/2012, 09:24 PM   #18
Nice-.-
Huge Clucker
 
Nice-.-'s Avatar
 
Join Date: Oct 2012
Location: Los Santos/PR
Posts: 378
Reputation: 12
Default Re: Sistema de Surpresas 1.0

Aqui o PasteBin >> http://pastebin.com/7ZpCqabh

ou qui :P http://pastebin.com/raw.php?i=7ZpCqabh
Nice-.- is offline   Reply With Quote
Old 09/12/2012, 10:10 PM   #19
Zona_Sky
Gangsta
 
Zona_Sky's Avatar
 
Join Date: Sep 2012
Posts: 623
Reputation: 13
Default Re: Sistema de Surpresas 1.0

bom zin ._.
__________________
espero ter ajudado
Zona_Sky is offline   Reply With Quote
Old 09/12/2012, 11:16 PM   #20
BielCOP
Banned
 
Join Date: Nov 2012
Location: Estado de SP
Posts: 1,124
Reputation: -8
Default Re: Sistema de Surpresas 1.0

OBG pessoal, vlws a todos.

@POST em BLOGS permitido.

@EDIT: Ja postaram u.u
BielCOP 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] Substituição sistema Regular para sistema VIP DexterBR Português/Portuguese 3 29/11/2012 10:56 PM
[Tutorial] Sistema de Registro + Profissão + Sistema de Administração Nake01 Lançamentos/Releases 19 02/03/2012 09:30 PM


All times are GMT. The time now is 08:59 AM.


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