pomoc[mutiraj]

Započeo --Lood--, Septembar 27, 2012, 14:33:36 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

GM koji koristim: od 0
Problem :  e vako napravio sam CMD za mutiraj znacmi mutiraj id vreme razlog, i kad god igra podje kucat npr /b pozz
pise mutiran si tolko sekundi
evo primer
kucam /mutiraj 0 60 pozz
i sad kad igrac npr oce pisat na /b posalje mu se poruka
Mutiran si jos 60 sec
ja to isto kucam nakon 1 min
opet pise "Mutiran si jos 60 sec"
Dio scripte:
/*MUTIRAJ*/
CMD:mutiraj(playerid,params[])
{
if (PlayerInfo[playerid][pLogin] == 0) return SCM(playerid, BELA, "Prvo se uloguj");
if (PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,BELA,"Nisi ovlascen da koristis ovu komandu");
new playa;
new minuti;
new razlog[256];
new string[256];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
if(sscanf(params,"dds",playa,minuti,razlog)) return SCM(playerid, BELA, "{00C0FF}Koriscenje:{ffffff} /mutiraj [ID igraca] [minuta] [razlog]");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
PlayerInfo[playa][pMutiran] = 1;
PlayerInfo[playa][pMutiranVremena] = minuti * 60;
format(string, sizeof(string), "{F81414}Administrator:{ffffff} %s{F81414} je mutirao igraca:{ffffff} %s{00C0FF}||Minuta:{ffffff} %d{F81414}||Razlog:{ffffff} %s",sendername ,giveplayer,minuti,razlog);
ABroadCast(0x2D2DFFFF, string, 1);
mutiranjeLog(string);

new string1[256];
format(string1, sizeof(string1), "{F81414}Administrator:{ffffff} %s{F81414} vas je mutirao na{ffffff} %d minuta{F81414}||Razlog:{ffffff} %s",sendername,minuti,razlog);
SCM(playa,CRVENA,string1);
return 1;
}


pa jesi napravio timer da smanjuje varijablu za 1 nakon svake minute ? i da postavi timer igracu kojeg si mute ?
vidim nisi
forward mutiran(playerid);
public mutiran(playerid)
{
PlayerInfo[playerid][pMutiranVremena] -= 1;
if(PlayerInfo[playerid][pMutiranVremena] = 0)
{
PlayerInfo[playa][pMutiran] = 0;
}
return 1;
}

i u CMD di "mutas" dodaj
SetTimerEx("mutiran",60000, false, "i", playa);
i stavi PlayerInfo[playa][pMutiranVremena] = minuti  umjesto PlayerInfo[playa][pMutiranVremena] = minuti * 60; ne treba ti * 60

aaa tnx brt, pa da
Nisam nimalo razmisljo :s
samo ima jos jedan problem udefined symbol playa u publicu
ocul stavit playerid, ili gore stavir new playa;
?
Poslednja Izmena: Septembar 27, 2012, 17:10:02 POSLE PODNE od --Lood--

Citat: --Lood-- poslato Septembar 27, 2012, 17:02:26 POSLE PODNE
aaa tnx brt, pa da
Nisam nimalo razmisljo :s
samo ima jos jedan problem udefined symbol playa u publicu
ocul stavit playerid, ili gore stavir new playa;
?
moja greska, bio sam prekopirao varijablu pa mi ostalo playa
ugl prebaci u PlayerInfo[playerid][pMutiran] = 0;

Vegas.

/*MUTIRAJ*/
CMD:mutiraj(playerid,params[])
{
if (PlayerInfo[playerid][pLogin] == 0) return SCM(playerid, BELA, "Prvo se uloguj");
if (PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,BELA,"Nisi ovlascen da koristis ovu komandu");
new playa;
new minuti;
new razlog[256];
new string[256];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
if(sscanf(params,"dds",playa,minuti,razlog)) return SCM(playerid, BELA, "{00C0FF}Koriscenje:{ffffff} /mutiraj [ID igraca] [minuta] [razlog]");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
PlayerInfo[playa][pMutiran] = 1;
PlayerInfo[playa][pMutiranVremena] = minuti * 60;
format(string, sizeof(string), "{F81414}Administrator:{ffffff} %s{F81414} je mutirao igraca:{ffffff} %s{00C0FF}||Minuta:{ffffff} %d{F81414}||Razlog:{ffffff} %s",sendername ,giveplayer,minuti,razlog);
ABroadCast(0x2D2DFFFF, string, 1);
mutiranjeLog(string);
SetTimerEx("UnMute", minuti * 60, 1,"i",playerid);

new string1[256];
format(string1, sizeof(string1), "{F81414}Administrator:{ffffff} %s{F81414} vas je mutirao na{ffffff} %d minuta{F81414}||Razlog:{ffffff} %s",sendername,minuti,razlog);
SCM(playa,CRVENA,string1);
return 1;
}

stock UnMute(playerid)
{
PlayerInfo[playa][pMutiran] = 0;
PlayerInfo[playa][pMutiranVremena] = 0;
return 1;
}