[Ajuda] Sistema de setar spree
#2

ajudei me de rep se nao nao ajudo + okay!!!
Quote:
PHP код:
/*================================================= ================================================== =========*/
#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(playeridreason)
{
printf("\nSprees de %s foram salvos\n",PlayerName(playerid));
SaveSpree(playerid);
return 
1;
}
/*================================================= ================================================== =========*/
public OnPlayerDeath(playeridkilleridreason)
{
KillsSpree[killerid] ++;
KillsSpree[playerid] = 0;
if(
KillsSpree[killerid] >= 5)
{
GetPlayerName(killeridPlayer_NameMAX_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(playeridparams[])
{
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(playerSPlayer_NameMAX_PLAYER_NAME);
format(strings,256,"•|INFO| Jogador %s Contem %d de Spree |•",Player_Name,KillsSpree[playerid]);
SendClientMessageToAll(0xFF0023FF,strings);
return 
1;
}
CMD:setspree(playeridparams[])
{
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(playerPlayer_NameMAX_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 
iGetMaxPlayers(); != k; ++i)
{
InfoSpree[i] = TextDrawCreate(44.000000285.000000," ");
TextDrawFont(InfoSpree[i], 2);
TextDrawLetterSize(InfoSpree[i], 0.2900001.300000);
TextDrawColor(InfoSpree[i], 0x0DB0DDFF);
TextDrawSetOutline(InfoSpree[i], 1);
TextDrawSetProportional(InfoSpree[i], 1);
}
/*================================================= ================================================== =========*/
BoxSpree TextDrawCreate(41.000000276.000000"~n~");
TextDrawBackgroundColor(BoxSpree255);
TextDrawFont(BoxSpree1);
TextDrawLetterSize(BoxSpree,0.3700003.399998);
TextDrawColor(BoxSpree0);
TextDrawSetOutline(BoxSpree0);
TextDrawSetProportional(BoxSpree1);
TextDrawSetShadow(BoxSpree1);
TextDrawUseBox(BoxSpree1);
TextDrawBoxColor(BoxSpree80);
TextDrawTextSize(BoxSpree150.0000000.000000);
if(!
fexist("sprees.ini")) dini_Create("sprees.ini");
return 
1;
}
/*================================================= ================================================== =========*/
public OnPlayerUpdate(playerid)
{
OnUpdateScore(playerid);
return 
1;
}
/*================================================= ================================================== =========*/
stock OnUpdateScore(playerid)
{
format(stringssizeof(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(playeridNameisizeof(Namei));
return 
Namei;
}
/*================================================= ================================================== =========*/ 
Reply


Messages In This Thread
Sistema de setar spree - by Bl4ckN3w - 22.12.2012, 19:24
Re: Sistema de setar spree - by joaobgnc - 22.12.2012, 19:30
Re: Sistema de setar spree - by Bl4ckN3w - 22.12.2012, 20:01
Re: Sistema de setar spree - by joaobgnc - 22.12.2012, 20:13

Forum Jump:


Users browsing this thread: 1 Guest(s)