SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/05/2012, 02:36 PM   #1
4LiSs0N
Gangsta
 
4LiSs0N's Avatar
 
Join Date: Aug 2011
Location: |Xaxim|SC|
Posts: 623
Reputation: 27
Default Sprees System Simple V.1 [Sistema de Matança]

Galera Estou Postando o Sprees System V.1
Oque tem de Novo?
A Textdraw Foi Mudada de Local
Admins na Rcon Pode Usar o Comando:
/Setspree [id] [Sprees] - Seta o spree do Player
Player Comuns Pode Usar o Comando:
/Spreeinfo [id] - Vê Quanto de spree o Player tem
Os Sprees Sao Salvos ao Desconectar do Jogo
ao Player Entrar ao Jogo Sera Setado Para quantos de Sprees que Ele tinha antes de desconectar!
os sprees dos players ficaram no arquivo "sprees.ini"

Imagem:



Includes Necesarias:
#include a_samp
#Include Dini | Usei Dini pois nao sei muito sobre outros modo de salvamento
#Include zcmd
#include sscanf2


#Code#
pawn Code:
/*|||||||||||||||||||||||Sprees System v.1 Feito Por [ZNS].[KrauZeR]_.|||4LiSs0N|||||||||||||||||||||||||||||||*/
/*============================================================================================================*/
#include <a_samp>
#include <Dini>
#include <ZCMD>
#include <sscanf2>
new     KillsSpree[MAX_PLAYERS],
        Text:InfoSpree[MAX_PLAYERS],
        Player_Name[MAX_PLAYER_NAME],
        Text:BoxSpree,
        strings[100]
;
/*============================================================================================================*/
public OnPlayerConnect(playerid)
{
   OnUpdateScore(playerid);
   LoginSpree(playerid);
   return 1;
}
/*============================================================================================================*/
public OnPlayerDisconnect(playerid, reason)
{
   printf("\nSprees de %s foram salvos\n",PlayerName(playerid));
   SaveSpree(playerid);
   return 1;
}
/*============================================================================================================*/

public OnPlayerDeath(playerid, killerid, reason)
{
    KillsSpree[killerid] ++;
    KillsSpree[playerid] = 0;

    if(KillsSpree[killerid] >= 5)
    {
        GetPlayerName(killerid, Player_Name, MAX_PLAYER_NAME);
        format(strings,256,"{33CCFF}%s{FF0023}Chegou nos {33CCFF}%d{FF0023} de Spree",PlayerName(playerid), KillsSpree[killerid]);
        SendClientMessageToAll(0xFF0023FF,strings);
    }
    OnUpdateScore(killerid);
    return 1;
}
/*============================================================================================================*/
CMD:spreeinfo(playerid, params[])
{
    new playerS;
    if(sscanf(params, "ud", playerS))
    return SendClientMessage(playerid, -1, "[ERRO] Use: /spreeinfo [id]");
    if(!IsPlayerConnected(playerS))
    return SendClientMessage(playerid, -1, "[ERRO] Jogador não conectado");
    GetPlayerName(playerS, Player_Name, MAX_PLAYER_NAME);
    format(strings,256,"•|INFO| Jogador %s Contem %d de Spree |•",Player_Name,KillsSpree[playerid]);
    SendClientMessageToAll(0xFF0023FF,strings);
    return 1;
}
CMD:setspree(playerid, params[])
{
    new player,sprees;
    if(!IsPlayerAdmin(playerid))
    return SendClientMessage(playerid, -1, "[ERRO] Sem autorização para usar esse comando!");
    if(sscanf(params, "ud", player,sprees))
    return SendClientMessage(playerid, -1, "[ERRO] Use: /setspree [id] [Spree]");
    if(!IsPlayerConnected(player))
    return SendClientMessage(playerid, -1, "[ERRO] Jogador não conectado");
    KillsSpree[player] = sprees;
    GetPlayerName(player, Player_Name, MAX_PLAYER_NAME);
    format(strings,256,"• Você setou o spree de %s para %d •",Player_Name,sprees);
    SendClientMessage(playerid,0xFF0023FF,strings);
    return 1;
}
/*============================================================================================================*/
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid,BoxSpree);
    TextDrawShowForPlayer(playerid,InfoSpree[playerid]);
    return 1;
}
/*============================================================================================================*/
public OnFilterScriptInit()
{
    for(new i, k = GetMaxPlayers(); i != k; ++i)
    {
        InfoSpree[i] = TextDrawCreate(44.000000, 285.000000," ");
        TextDrawFont(InfoSpree[i], 2);
        TextDrawLetterSize(InfoSpree[i], 0.290000, 1.300000);
        TextDrawColor(InfoSpree[i], 0x0DB0DDFF);
        TextDrawSetOutline(InfoSpree[i], 1);
        TextDrawSetProportional(InfoSpree[i], 1);
    }
/*============================================================================================================*/
    BoxSpree = TextDrawCreate(41.000000, 276.000000, "~n~");
    TextDrawBackgroundColor(BoxSpree, 255);
    TextDrawFont(BoxSpree, 1);
    TextDrawLetterSize(BoxSpree,0.370000, 3.399998);
    TextDrawColor(BoxSpree, 0);
    TextDrawSetOutline(BoxSpree, 0);
    TextDrawSetProportional(BoxSpree, 1);
    TextDrawSetShadow(BoxSpree, 1);
    TextDrawUseBox(BoxSpree, 1);
    TextDrawBoxColor(BoxSpree, 80);
    TextDrawTextSize(BoxSpree, 150.000000, 0.000000);

    if(!fexist("sprees.ini")) dini_Create("sprees.ini");
    return 1;
}
/*============================================================================================================*/
public OnPlayerUpdate(playerid)
{
    OnUpdateScore(playerid);
    return 1;
}
/*============================================================================================================*/
stock OnUpdateScore(playerid)
{
    format(strings, sizeof(strings),"Spree:~w~ %d",KillsSpree[playerid]);
    TextDrawSetString(InfoSpree[playerid],strings);
    return 1;
}
/*============================================================================================================*/
stock SaveSpree(playerid)
{
    dini_IntSet("sprees.ini",PlayerName(playerid),KillsSpree[playerid]);
    return 1;
}
/*============================================================================================================*/
stock LoginSpree(playerid)
{
    if(dini_Isset("sprees.ini",PlayerName(playerid)))  KillsSpree[playerid] = (playerid,dini_Int("sprees.ini",PlayerName(playerid)));
    return 1;
}
/*============================================================================================================*/
stock PlayerName(playerid)
{
    new Namei[MAX_PLAYERS];
    GetPlayerName(playerid, Namei, sizeof(Namei));
    return Namei;
}
/*============================================================================================================*/

Espero que Gostem
Creditos:
|[ZNS].[KrauZeR]_. | 4LiSs0N| e Garfield (OnUpdateScore)
Dispenso Criticas Comentários fúteis!
4LiSs0N is offline   Reply With Quote
Old 09/05/2012, 02:41 PM   #2
FriendrS
Big Clucker
 
Join Date: Jan 2012
Posts: 106
Reputation: 1
Default Re: Sprees System Simple V.1 [Sistema de Matança]

Muito Bom a Nova versão Os players gostam disso pra eles é um desafio quem tem mais sprees
Ainda mais agora que salva parabéns o /setspree que eu gostei mais
FriendrS is offline   Reply With Quote
Old 09/05/2012, 02:42 PM   #3
4LiSs0N
Gangsta
 
4LiSs0N's Avatar
 
Join Date: Aug 2011
Location: |Xaxim|SC|
Posts: 623
Reputation: 27
Default Re: Sprees System Simple V.1 [Sistema de Matança]

Vlw Friend
4LiSs0N is offline   Reply With Quote
Old 09/05/2012, 02:46 PM   #4
Hancoc
Big Clucker
 
Join Date: Jan 2012
Posts: 68
Reputation: 0
Default Re: Sprees System Simple V.1 [Sistema de Matança]

Ficou Otimo cara Concerteza vou usar
com os devidos creditos claro
Hancoc is offline   Reply With Quote
Old 09/05/2012, 02:47 PM   #5
4LiSs0N
Gangsta
 
4LiSs0N's Avatar
 
Join Date: Aug 2011
Location: |Xaxim|SC|
Posts: 623
Reputation: 27
Default Re: Sprees System Simple V.1 [Sistema de Matança]

Vlw Hencoc Bom Proveito '-'
4LiSs0N is offline   Reply With Quote
Old 09/05/2012, 04:00 PM   #6
dPlaYer_
High-roller
 
dPlaYer_'s Avatar
 
Join Date: Jul 2011
Location: Salvador
Posts: 1,736
Reputation: 179
Default Re: Sprees System Simple V.1 [Sistema de Matança]

Dini Matou tudo '-

Porem o sistema ficou legal
__________________
dPlaYer_ is offline   Reply With Quote
Old 09/05/2012, 04:27 PM   #7
RoacH`
Huge Clucker
 
RoacH`'s Avatar
 
Join Date: Apr 2012
Posts: 276
Reputation: 27
Default Re: Sprees System Simple V.1 [Sistema de Matança]

pawn Code:
if(sscanf(params, "ud", playerS))
?
@Poderias utilizar algo mas avançado "foreach and dof2"
RoacH` is offline   Reply With Quote
Old 12/05/2012, 10:56 PM   #8
'Duallity
Big Clucker
 
'Duallity's Avatar
 
Join Date: Apr 2012
Location: Grajaú-Ma
Posts: 188
Reputation: 9
Default Re: Sprees System Simple V.1 [Sistema de Matança]

Quote:
Originally Posted by RoacH` View Post
pawn Code:
if(sscanf(params, "ud", playerS))
?
@Poderias utilizar algo mas avançado "foreach and dof2"
sscanf nao é algo tao ultrapassado --'
__________________
'Duallity is offline   Reply With Quote
Old 13/05/2012, 01:00 AM   #9
Hiuship
Huge Clucker
 
Join Date: Sep 2010
Posts: 315
Reputation: 13
Default Re: Sprees System Simple V.1 [Sistema de Matança]

Quote:
Originally Posted by 'Duallity View Post
sscanf nao é algo tao ultrapassado --'


Ele nao disse isso... olhe o code... está errado.. e o que ele disse era para o cara usar outras coisas ao invez doque usa...
__________________

Clique no banner e confira os planos!!
Hiuship 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
[FilterScript] Sistema de Matança/KillsSpree [PEDIDO] 4LiSs0N Lançamentos/Releases 27 28/04/2012 02:40 PM
[Tutorial] [TUT] Making your own Killing Sprees. Brian_G Tutorials 30 12/09/2011 12:41 PM
[NEED SERIOUS HELP]Killing Sprees Tigerbeast11 Help Archive 3 12/10/2009 05:07 PM


All times are GMT. The time now is 01:58 AM.


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