[pomoc] /ad

Započeo sampzone, April 20, 2011, 23:21:28 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

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!

pa koristis PlayerToPoint. da igrac mora doci na odredjeno mjesto kako bi mogao dati oglas (/ad)

mozel primjer kako da rjesim?

poznaticovik

Daj komandu ako ne znaš sam ubaciti , ako znaš koristi IsPlayerInRangeOfPoint

if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(gPlayerLogged[playerid] == 0)
           {
               SendClientMessage(playerid, COLOR_GREY, "** Moras se ulogirati !");
               return 1;
           }
           if(PlayerInfo[playerid][pMuted] == 1)
         {
            SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nemozes pricati,usutkan si");
            return 1;
         }
         new length = strlen(cmdtext);
         while ((idx < length) && (cmdtext[idx] <= ' '))
         {
            idx++;
         }
         new offset = idx;
         new result[128];
         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
         {
            result[idx - offset] = cmdtext[idx];
            idx++;
         }
         result[idx - offset] = EOS;
         if(!strlen(result))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: (/ad)vertise [text]");
            return 1;
         }
         if ((!adds) && (PlayerInfo[playerid][pAdmin] < 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[playerid][pPnumber]);
         SendClientMessageToAll(COLOR_LIGHTGREEN,string);
         GameTextForPlayer(playerid, "~w~Oglas ~n~~w~Cijena:~g~$50", 4321,1);
         if (PlayerInfo[playerid][pAdmin] < 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;
   }


pa jel ti pomogao?

odes na mjesto gdje oces kucas /save i onda te koordiante stavis ode
if(IsPlayerInRangeOfPoint(playerid, 5.0, tvoje koordinate))
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

Vanilla je uradio dobro i to treba raditi,ako ti neradi pokrij se usima,ocito neznas ubacit :D
Citat: Correlli poslato Maj 03, 2011, 17:45:02 POSLE PODNE
Citat: Petar_Black poslato Maj 03, 2011, 17:19:10 POSLE PODNE
Ohh..Nisam se nadao da ce ovakve odlicne ocene biti..:D..Na prvoj stranici sve 0/10 a na drugoj 100000/10 :D...Hvala puno..:DD :-*

U moju si temu došao, a ne u svoju...
Hahahah koji isus izgubio se malo :D

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[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "** Moras se logovati !");
            return 1;
        }
        if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozes pricati,usutkan si");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: (/ad)vertise [text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 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[playerid][pPnumber]);
SendClientMessageToAll(COLOR_ORANGE,string);
GameTextForPlayer(playerid, "~w~Oglas ~n~~w~Cijena:~g~$50", 4321,1);
if (PlayerInfo[playerid][pAdmin] < 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;
}


matematicar, pa ti si mu postao cmd, kakvu je on i imao. xD. procitaj malo bolje prvi post sampzone-a.

Citat: [BTS]Mike poslato April 21, 2011, 11:34:25 PRE PODNE
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 :)

if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
            if(IsPlayerInRangeOfPoint(playerid, 7.0, [b]X,Y,Z[/b]))
           {
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "** Moras se ulogirati !");
            return 1;
        }
        if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nemozes pricati,usutkan si");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: (/ad)vertise [text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 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[playerid][pPnumber]);
SendClientMessageToAll(COLOR_LIGHTGREEN,string);
GameTextForPlayer(playerid, "~w~Oglas ~n~~w~Cena:~g~$50", 4321,1);
if (PlayerInfo[playerid][pAdmin] < 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...

opet mogu /ad sa svakog mjesta i ako sam kordinate stavio
Poslednja Izmena: April 22, 2011, 00:48:56 PRE PODNE od sampzone