Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: sampzone poslato April 20, 2011, 23:21:28 POSLE PODNE

Naslov: [pomoc] /ad
Poruka od: sampzone poslato April 20, 2011, 23:21:28 POSLE PODNE
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!
Naslov: Odg: [pomoc] /ad
Poruka od: .G.h.0.s.T. poslato April 20, 2011, 23:51:45 POSLE PODNE
pa koristis PlayerToPoint. da igrac mora doci na odredjeno mjesto kako bi mogao dati oglas (/ad)
Naslov: Odg: [pomoc] /ad
Poruka od: sampzone poslato April 20, 2011, 23:53:11 POSLE PODNE
mozel primjer kako da rjesim?
Naslov: Odg: [pomoc] /ad
Poruka od: poznaticovik poslato April 20, 2011, 23:53:29 POSLE PODNE
Daj komandu ako ne znaš sam ubaciti , ako znaš koristi IsPlayerInRangeOfPoint
Naslov: Odg: [pomoc] /ad
Poruka od: sampzone poslato April 21, 2011, 00:09:09 PRE PODNE
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;
   }
Naslov: Odg: [pomoc] /ad
Poruka od: sampzone poslato April 21, 2011, 09:56:38 PRE PODNE
mozel pomoci ko??????
Naslov: Odg: [pomoc] /ad
Poruka od: System32 poslato April 21, 2011, 10:06:51 PRE PODNE
pa jel ti pomogao?

odes na mjesto gdje oces kucas /save i onda te koordiante stavis ode
if(IsPlayerInRangeOfPoint(playerid, 5.0, tvoje koordinate))
Naslov: Odg: [pomoc] /ad
Poruka od: Firefox.pwn poslato April 21, 2011, 10:13:16 PRE PODNE
Vanilla je uradio dobro i to treba raditi,ako ti neradi pokrij se usima,ocito neznas ubacit :D
Naslov: Odg: [pomoc] /ad
Poruka od: [TS] Killer NO. 1 poslato April 21, 2011, 11:03:58 PRE PODNE
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;
}

Naslov: Odg: [pomoc] /ad
Poruka od: .G.h.0.s.T. 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.
Naslov: Odg: [pomoc] /ad
Poruka od: [TS] Killer NO. 1 poslato April 21, 2011, 12:23:41 POSLE PODNE
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 :)
Naslov: Odg: [pomoc] /ad
Poruka od: Mario_ poslato April 21, 2011, 12:26:13 POSLE PODNE
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...
Naslov: Odg: [pomoc] /ad
Poruka od: sampzone poslato April 21, 2011, 22:45:55 POSLE PODNE
opet mogu /ad sa svakog mjesta i ako sam kordinate stavio