[Pomoc]/duty

Započeo Ante_Street
pre 14 godina
1,002
pregleda
8
postova
Ante_Street
Shot Caller
pre 14 godina
Skripta koju koristim: LARP
Detaljan opis problema: Definira sam point na kojem se uzima duty,al problem je u tome sto se moze uzet na cijelom serveru....nezz u cemu je problem
Dio skripte:
if(strcmp(cmd, "/duty", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo == 1 || PlayerInfo == 1 || PlayerInfo == 2 || PlayerInfo == 2 || PlayerInfo == 3 || PlayerInfo == 3)
{
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(3,playerid,-2455.2380,503.9444,30.0781) ||PlayerInfo != 255)
{
if(OnDuty==0)
       {
    format(string, sizeof(string), "* Cuvar zakona %s je uzeo znacku i oruzje iz ormarica.", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
GivePlayerWeapon(playerid, 24, 70);
GivePlayerWeapon(playerid, 3, 0);
OnDuty = 1;
}
else if(OnDuty==1)
{
format(string, sizeof(string), "* Cuvar zakona %s je stavio znacku i oruzje u ormaric.", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
GivePlayerWeapon(playerid, 23, 150);
GivePlayerWeapon(playerid, 5, 0);
OnDuty = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nisi u sobi sa ormaricima !");
return 1;
}
}
else if(PlayerInfo == 4||PlayerInfo == 4)
{
   if(JobDuty == 1)
   {
       SendClientMessage(playerid, COLOR_LIGHTBLUE, "*  Vise nisi na duznosti sa poslom bolnicara i vise neces primati pozive.");
       JobDuty = 0;
       Medics -= 1;
   }
   else
   {
       SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Sad si na duznosti sa poslom bolnicara i primat ces pozive od ozlijedenih ljudi.");
       JobDuty = 1;
       Medics += 1;
   }
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Mr.Lowrey
Godfather
pre 14 godina
koristi IsPlayerInRangeOfPoint
Ante_Street
Shot Caller
pre 14 godina
Quote from June 13, 2011, 8:56 pm:
koristi IsPlayerInRangeOfPoint

Nece...ako nemos nac u cem je problem de mi svoj ak nebude radio ni on onda neznam di je problem
Luis
Godfather
pre 14 godina
Evo ovako :
if(strcmp(cmd, "/duty", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo == 1 || PlayerInfo == 1 || PlayerInfo == 2 || PlayerInfo == 2 || PlayerInfo == 3 || PlayerInfo == 3)
{
if (IsPlayerInRangeOfPoint(3, playerid,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(3,playerid,-1616.1294,681.1594,7.1875) || IsPlayerInRangeOfPoint(3,playerid,-2455.2380,503.9444,30.0781) ||PlayerInfo != 255)
{
if(OnDuty==0)
        {
    format(string, sizeof(string), "* Cuvar zakona %s je uzeo znacku i oruzje iz ormarica.", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
GivePlayerWeapon(playerid, 24, 70);
GivePlayerWeapon(playerid, 3, 0);
OnDuty = 1;
}
else if(OnDuty==1)
{
format(string, sizeof(string), "* Cuvar zakona %s je stavio znacku i oruzje u ormaric.", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
GivePlayerWeapon(playerid, 23, 150);
GivePlayerWeapon(playerid, 5, 0);
OnDuty = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "  Nisi u sobi sa ormaricima !");
return 1;
}
}
else if(PlayerInfo == 4||PlayerInfo == 4)
{
    if(JobDuty == 1)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "*  Vise nisi na duznosti sa poslom bolnicara i vise neces primati pozive.");
        JobDuty = 0;
        Medics -= 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Sad si na duznosti sa poslom bolnicara i primat ces pozive od ozlijedenih ljudi.");
        JobDuty = 1;
        Medics += 1;
    }
}
}
return 1;
}
Ante_Street
Shot Caller
pre 14 godina
Quote from June 13, 2011, 9:43 pm:
Evo ovako :
if(strcmp(cmd, "/duty", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo == 1 || PlayerInfo == 1 || PlayerInfo == 2 || PlayerInfo == 2 || PlayerInfo == 3 || PlayerInfo == 3)
{
if (IsPlayerInRangeOfPoint(3, playerid,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(3,playerid,-1616.1294,681.1594,7.1875) || IsPlayerInRangeOfPoint(3,playerid,-2455.2380,503.9444,30.0781) ||PlayerInfo != 255)
{
if(OnDuty==0)
       {
    format(string, sizeof(string), "* Cuvar zakona %s je uzeo znacku i oruzje iz ormarica.", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
GivePlayerWeapon(playerid, 24, 70);
GivePlayerWeapon(playerid, 3, 0);
OnDuty = 1;
}
else if(OnDuty==1)
{
format(string, sizeof(string), "* Cuvar zakona %s je stavio znacku i oruzje u ormaric.", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
GivePlayerWeapon(playerid, 23, 150);
GivePlayerWeapon(playerid, 5, 0);
OnDuty = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nisi u sobi sa ormaricima !");
return 1;
}
}
else if(PlayerInfo == 4||PlayerInfo == 4)
{
   if(JobDuty == 1)
   {
       SendClientMessage(playerid, COLOR_LIGHTBLUE, "*  Vise nisi na duznosti sa poslom bolnicara i vise neces primati pozive.");
       JobDuty = 0;
       Medics -= 1;
   }
   else
   {
       SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Sad si na duznosti sa poslom bolnicara i primat ces pozive od ozlijedenih ljudi.");
       JobDuty = 1;
       Medics += 1;
   }
}
}
return 1;
}

probao sam neradi.......odnosno radi ali po cijelom serveru,a ne kod lokera u pd kako bi ja htjeo
Mr.Lowrey
Godfather
pre 14 godina
L84S Sta ti baljezgas?Pa ne idu parametrui u IsPlayerInRangeOfPoint kao u PlayerToPoint
if(strcmp(cmd, "/duty", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo == 1 || PlayerInfo == 1 || PlayerInfo == 2 || PlayerInfo == 2 || PlayerInfo == 3 || PlayerInfo == 3)
{
if (IsPlayerInRangeOfPoint(playerid, 3, 255.3, 77.4, 1003.6) || IsPlayerInRangeOfPoint(playerid, 3, -1616.1294, 681.1594, 7.1875) || IsPlayerInRangeOfPoint(playerid, 3, -2455.2380, 503.9444, 30.0781) ||PlayerInfo != 255)
{
if(OnDuty==0)
        {
    format(string, sizeof(string), "* Cuvar zakona %s je uzeo znacku i oruzje iz ormarica.", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
GivePlayerWeapon(playerid, 24, 70);
GivePlayerWeapon(playerid, 3, 0);
OnDuty = 1;
}
else if(OnDuty==1)
{
format(string, sizeof(string), "* Cuvar zakona %s je stavio znacku i oruzje u ormaric.", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
GivePlayerWeapon(playerid, 23, 150);
GivePlayerWeapon(playerid, 5, 0);
OnDuty = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "  Nisi u sobi sa ormaricima !");
return 1;
}
}
else if(PlayerInfo == 4||PlayerInfo == 4)
{
    if(JobDuty == 1)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "*  Vise nisi na duznosti sa poslom bolnicara i vise neces primati pozive.");
        JobDuty = 0;
        Medics -= 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Sad si na duznosti sa poslom bolnicara i primat ces pozive od ozlijedenih ljudi.");
        JobDuty = 1;
        Medics += 1;
    }
}
}
return 1;
}
Ante_Street
Shot Caller
pre 14 godina
nevalja ni taj tvoj isto mogu uzimat duty bilo gdje na serveru -.-
bake_pg
Wheel Man
pre 14 godina
Izbrisi ovaj dio iz if uslova (što sam boldirao):

if (IsPlayerInRangeOfPoint(playerid, 3, 255.3, 77.4, 1003.6) || IsPlayerInRangeOfPoint(playerid, 3, -1616.1294, 681.1594, 7.1875) || IsPlayerInRangeOfPoint(playerid, 3, -2455.2380, 503.9444, 30.0781) ||PlayerInfo != 255)

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava