[pomoc] /ad

Započeo sampzone
20. Apr. 2011.
1,407
pregleda
13
postova
sampzone
5
Underboss
20. Apr. 2011.
mod koji ja koristim: ravens edit

problem: mozel mi neko pomoci kako da napravim da se mogu oglasi objaviti (/ad) samo sa mjesta odredjenog a ne sa cjelog servera.....?

dio skripte: dacu vam sta treba samo recite

hvala za pomoc unaprijed!
Mike93
4
Enforcer
20. Apr. 2011.
pa koristis PlayerToPoint. da igrac mora doci na odredjeno mjesto kako bi mogao dati oglas (/ad)
sampzone
5
Underboss
20. Apr. 2011.
mozel primjer kako da rjesim?
Deleted User
Obrisan korisnik
20. Apr. 2011.
Daj komandu ako ne znaš sam ubaciti , ako znaš koristi IsPlayerInRangeOfPoint
sampzone
5
Underboss
20. Apr. 2011.
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "** Moras se ulogirati !");
            return 1;
        }
        if(PlayerInfo == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nemozes pricati,usutkan si");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: (/ad)vertise ");
return 1;
}
if ((!adds) && (PlayerInfo < 1))
{
format(string, sizeof(string), "** Pokusajte ponovno nakon %d sekundi izmedju odgasa !",  (addtimer/60000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
SafeGivePlayerMoney(playerid, -50);
format(string, sizeof(string), "OGLAS: %s, Autor %s (Tel: %d)",  result, sendername ,PlayerInfo);
SendClientMessageToAll(COLOR_LIGHTGREEN,string);
GameTextForPlayer(playerid, "~w~Oglas ~n~~w~Cijena:~g~$50", 4321,1);
if (PlayerInfo < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
new y,m,d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (Oglas): %s",d,m,y,h,mi,s, sendername, result);
ChatLog(string);
  }
return 1;
}
sampzone
5
Underboss
21. Apr. 2011.
mozel pomoci ko😕😕
Mr.Lowrey
5
Godfather
21. Apr. 2011.
pa jel ti pomogao?

odes na mjesto gdje oces kucas /save i onda te koordiante stavis ode
 if(IsPlayerInRangeOfPoint(playerid, 5.0, tvoje koordinate))
Cika
4
Shot Caller
21. Apr. 2011.
Vanilla je uradio dobro i to treba raditi,ako ti neradi pokrij se usima,ocito neznas ubacit 😄
matematicar
4
Enforcer
21. Apr. 2011.
Evo ja imam jedan Edit ravensa pa evo probaj ovako

if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "** Moras se logovati !");
            return 1;
        }
        if(PlayerInfo == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozes pricati,usutkan si");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: (/ad)vertise ");
return 1;
}
if ((!adds) && (PlayerInfo < 1))
{
format(string, sizeof(string), "** Pokusajte ponovno nakon %d sekundi izmedju odgasa !",  (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
SafeGivePlayerMoney(playerid, -50);
format(string, sizeof(string), "OGLAS: %s, Kontakt %s (Tel: %d)",  result, sendername ,PlayerInfo);
SendClientMessageToAll(COLOR_ORANGE,string);
GameTextForPlayer(playerid, "~w~Oglas ~n~~w~Cijena:~g~$50", 4321,1);
if (PlayerInfo < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
new y,m,d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (Advertisement): %s",d,m,y,h,mi,s, sendername, result);
ChatLog(string);
  }
return 1;
}
Mike93
4
Enforcer
21. Apr. 2011.
matematicar, pa ti si mu postao cmd, kakvu je on i imao. xD. procitaj malo bolje prvi post sampzone-a.
matematicar
4
Enforcer
21. Apr. 2011.
Quote from April 21, 2011, 9:34 am:
matematicar, pa ti si mu postao cmd, kakvu je on i imao. xD. procitaj malo bolje prvi post sampzone-a.


Inace tajmeri su drugacije podeseni 🙂
Mario_97so
4
Shot Caller
21. Apr. 2011.
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
            if(IsPlayerInRangeOfPoint(playerid, 7.0, X,Y,Z))
          {
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "** Moras se ulogirati !");
            return 1;
        }
        if(PlayerInfo == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nemozes pricati,usutkan si");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: (/ad)vertise ");
return 1;
}
if ((!adds) && (PlayerInfo < 1))
{
format(string, sizeof(string), "** Pokusajte ponovno nakon %d sekundi izmedju oglasa !",  (addtimer/60000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
SafeGivePlayerMoney(playerid, -50);
format(string, sizeof(string), "OGLAS: %s, Autor %s (Tel: %d)",  result, sendername ,PlayerInfo);
SendClientMessageToAll(COLOR_LIGHTGREEN,string);
GameTextForPlayer(playerid, "~w~Oglas ~n~~w~Cena:~g~$50", 4321,1);
if (PlayerInfo < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
new y,m,d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (Oglas): %s",d,m,y,h,mi,s, sendername, result);
ChatLog(string);
  }
return 1;
}
}

* X,Y,Z zameni sa svojim koordinatama gde hoces oglasnu kompaniju ili sta vec hoces i radice ti samo u blizini te lokacije.Valjda ti nije problem zameniti stari /ad sa ovim i promeniti koordinate...
sampzone
5
Underboss
21. Apr. 2011.
opet mogu /ad sa svakog mjesta i ako sam kordinate stavio

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha