[Ajuda] Sistema de setar spree
#1

Ae qem pode me ajudar a fazer esse sistema nao to conseguindo eu fiz mas ele nao seto os spree do player.
o DCMD

dcmd(setspree,8,cmdtext);


dcmd_setspree(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 7) {
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USO: /setspree [playerid] [spree]");
new player1 = strval(tmp), lastspree = strval(tmp2), string[128];
if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERRO: Vocк nгo pode usar este comando neste admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
CMDMessageToAdmins(playerid,"SETSPREE");
format(string, sizeof(string), "Vocк definiu o spree de \"%s\" para '%d' ", pName(player1), lastspree); SendClientMessage(playerid,blue,string);
if(player1 != playerid) { format(string,sizeof(string),"Administrador \"%s\" definiu seus spree para '%d'", pName(playerid), lastspree); SendClientMessage(player1,blue,string); }
return PlayerInfo[player1][LastSpree] = lastspree;
} else return SendClientMessage(playerid,red,"[ERRO]: Jogador nao conectado");
} else return SendClientMessage(playerid,red,"[ERRO]: Vocк nгo tem permissгo para isso");
}

eu fiz osistema mas ele nao esta setando spree pra quem puder me ajudar ta ae.
Reply
#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
#3

Nao entendi seu sistema de setar spree sou novo mexendo com pawno se puder me falar o q posso ta fazendo errado seria melhor .

meu msn
gustavoext3rminador@hotmail.com
Reply
#4

okay adcionando so aceita
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)