Skripta koju koristim:FG
Detaljan opis problema:kako da napravi da kada ja igraca mute da on se on mora unmute gdje ja stavim na kordinatama? i da plati kolko stavim da se unmute.hvala unaprijed
Dio skripte: //
Ja te nekontam, ti oÄeÅ¡ stavit da igraÄ kupuje "unmute" ?
lolllllll kada igraca ja /mute da on mora da ode i da plati negdje da bi to skinio da moze da pise opet kontas li sad 8)
PlayerToPoint koristi za koordinate a GivePlayerMoney(playerid,-kolicina); ...Sta ti je tu tesko ...?
Tesko je jer nemam uopste tu komandu u modu :(
Ima samo /unmuteall komanda
Citat: ¢fgâ,,¢'87 poslato Mart 15, 2012, 14:49:14 POSLE PODNE
Tesko je jer nemam uopste tu komandu u modu :(
Ima samo /unmuteall komanda
Uzmi /unmuteall i prmeni u umute i da to moze bilo tko i koristi IsPlayerInRange ili PlayerToPoint
Citat: ¢fgâ,,¢'87 poslato Mart 15, 2012, 14:49:14 POSLE PODNE
Tesko je jer nemam uopste tu komandu u modu :(
Ima samo /unmuteall komanda
Mnogo tu i ima sta,samo varijablu za mute-anje postavis na 0 ...Ae postavi tu komandu unmuteall !
evo komande.
if (strcmp("/unmuteall", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
foreach (Player, i)
{
if(PlayerInfo[i][pMuted] == 1)
{
PlayerInfo[i][pMuted] = 0;
}
}
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("AdmCmd: %s je omogucio govor svim igracima",sendername);
format(string, sizeof(string), "AdmCmd: %s je omogucio govor svim igracima",sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Niste ovlasteni da koristite tu komandu !");
}
}
return 1;
}
Evo primer :
if (strcmp("/unmute", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(20, playerid,x,y,z koordinate))
{
if(PlayerInfo[i][pMuted] == 1)
{
PlayerInfo[i][pMuted] = 0;
GivePlayerMoney(playerid, -kolicina);
}
}
return 1;
}
Kako da ubacim kada se unmute da mu ispise neku poruku i cetu?
lollllll 500postova kakve veze imaju postovi zivota ti tvog???????????? a gdje u komandi da to stavim znam i ja da tako ide send..
if (strcmp("/unmute", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(20, playerid,x,y,z koordinate))
{
if(PlayerInfo[i][pMuted] == 1)
{
PlayerInfo[i][pMuted] = 0;
GivePlayerMoney(playerid, -kolicina);
SendClientMessage(playerid, BOJA, "text");
}
}
return 1;
}
if (strcmp("/buyunmute", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, x,y,z)) // Kordinati gde će se kupovati unmute
{
if(PlayerInfo[i][pMuted] == 1)
{
PlayerInfo[i][pMuted] = 0; // Stavlja unmute
GivePlayerMoney(playerid, -100); // Cena unmutea
SendClientMessage(playerid, COLOR_GRAD, "INFO: Kupili ste unmute..."); // Text
}
}
return 1;
}
pise da nije definisan ovaj :S
if(PlayerInfo[iovo da nije definisano][pMuted] == 1)
if(PlayerInfo[playerid][pMuted] == 1)
Nece tako na drugaciji sam nacin rjesio eh kako samo da stavim kada nema pare da se nemoze unmute sada kada znaci nemam pare idem unmute i u banci bude minus.?hocu znaci da nemoze unmute ako nema,da se nista ne desi
if (strcmp("/unmute", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(20, playerid,x,y,z koordinate))
{
if(GetPlayerMoney(playerid) < Ovde stavis koliko najmanje mora da ima novca)
{
SendClientMessage(playerid, COLOR_GRAD, "Nemate Novca.");
return 1;
}
if(PlayerInfo[i][pMuted] == 1)
{
PlayerInfo[i][pMuted] = 0;
GivePlayerMoney(playerid, -kolicina);
SendClientMessage(playerid, BOJA, "text");
}
}
return 1;
}
if (strcmp("/unmute", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(20, playerid,x,y,z koordinate))
{
if(GetPlayerMoney(playerid) < Ovde stavis koliko najmanje mora da ima novca)
{
SendClientMessage(playerid, COLOR_GRAD, "Nemate Novca.");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1) //ovde ti ide playerid umesto onoga i
{
PlayerInfo[playerid][pMuted] = 0;
GivePlayerMoney(playerid, -kolicina);
SendClientMessage(playerid, BOJA, "text");
}
}
return 1;
}
stavi ovako i radice ti...
Citat: boban1995 poslato Mart 15, 2012, 15:59:53 POSLE PODNE
if (strcmp("/unmute", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(20, playerid,x,y,z koordinate))
{
if(GetPlayerMoney(playerid) < Ovde stavis koliko najmanje mora da ima novca)
{
SendClientMessage(playerid, COLOR_GRAD, "Nemate Novca.");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1) //ovde ti ide playerid umesto onoga i
{
PlayerInfo[playerid][pMuted] = 0;
GivePlayerMoney(playerid, -kolicina);
SendClientMessage(playerid, BOJA, "text");
}
}
return 1;
}
stavi ovako i radice ti...
Samo da je stavio gore foreach (Player, i) ne bi mu izbacivalo to...
Evo ti komanda:
if (strcmp("/unmute", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(5.0,playerid,-1059.5686,-1195.5486,129.3423)) //koordinate koje zelis za mjesto gdje igraci mogu da vrse komandu
{
if(GetPlayerMoney(playerid) < 50) //provjera novca
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca!.");
return 1;
}
if(PlayerInfo[i][pMuted] == 0) // provjera da li igrac ima pravo govora, ukoliko ima vratit ce mu return i SCM
{
SendClientMessage(playerid, COLOR_GREY, "Nije vam oduzeto pravo govora!");
return 1;
}
if(PlayerInfo[i][pMuted] == 1) // daje igracu pravo govora
{
PlayerInfo[i][pMuted] = 0;
GivePlayerMoney(playerid, -50);
GameTextForPlayer(playerid, "~r~-$50", 5000, 4);
SendClientMessage(playerid, COLOR_WHITE, "Platili ste pravo svog govora!");
}
}
return 1;
}
Ako se već koristi strcmp naÄin (Å¡to ja ne preporuÄujem), onda bi to najbolje bilo ovako:
if (strcmp("/unmute", cmdtext, true, 10) == 0) {
// Provjerava da li je igrac na trazenoj lokaciji
if(IsPlayerInRangeOfPoint(playerid, 5.0, -1059.5686, -1195.5486, 129.3423)) {
// Provjerava da li igrac ima dovoljno novaca
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca!.");
// Provjerava da li je igrac usutkan, ako je onda mu daje pravo govora, salje mu poruku i oduzme mu novac
if(PlayerInfo[i][pMuted] == 1) {
PlayerInfo[i][pMuted] = 0;
GivePlayerMoney(playerid, -50);
GameTextForPlayer(playerid, "~r~-$50", 5000, 4);
SendClientMessage(playerid, COLOR_WHITE, "Platili ste pravo svog govora!");
}
}
return 1;
}
evo ti all
[code]//UNMUTE ALL CMD
if (strcmp("/unmuteall", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
foreach (Player, i)
{
if(PlayerInfo[i][pMuted] == 1)
{
PlayerInfo[i][pMuted] = 0;
}
}
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("AdmCmd: %s je omogucio govor svim igracima",sendername);
format(string, sizeof(string), "("COL_RED"[EGRP-AS]{FFFFFF}!) "COL_RED"%s {FFFFFF}je omogucio govor svim igracima",sendername);
ABroadCast(WHITE,string,1);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Niste ovlasteni da koristite tu komandu !");
}
}
return 1;
}
[/code]
Citat: 3KvSi| poslato Mart 15, 2012, 16:40:21 POSLE PODNE
evo ti all
[code]//UNMUTE ALL CMD
if (strcmp("/unmuteall", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
foreach (Player, i)
{
if(PlayerInfo[i][pMuted] == 1)
{
PlayerInfo[i][pMuted] = 0;
}
}
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("AdmCmd: %s je omogucio govor svim igracima",sendername);
format(string, sizeof(string), "("COL_RED"[EGRP-AS]{FFFFFF}!) "COL_RED"%s {FFFFFF}je omogucio govor svim igracima",sendername);
ABroadCast(WHITE,string,1);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Niste ovlasteni da koristite tu komandu !");
}
}
return 1;
}
[/code]
jel si ti corav ili ti noge smrde? O.o