Pretraga

Pritisnite Enter za pretragu ili Escape za zatvaranje

[POMOC]/DUTY

Započeo m-a-r-k-o
pre 14 godina
577
pregleda
3
postova
m-a-r-k-o
Shot Caller
pre 14 godina
mod koji koristim:Raven's

Opis problema:problem je sa komandom /duty kad sam pd/fbi mogu otic na bilo koje mjestu na serveru onduty.

dio skripte:
	if(strcmp(cmd, "/duty", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(PlayerInfo == 1) return SendClientMessage(playerid, COLOR_GREY, "* Criminals can not go on duty!");
if(PlayerInfo == 1 || PlayerInfo == 1 || PlayerInfo == 2 || PlayerInfo == 2 || PlayerInfo == 3 || PlayerInfo == 3 || IsAFreecop(playerid))
{
if(PlayerInfo == 1)
{
SendClientMessage(playerid, COLOR_GREY, "* You are Banned from Cop Duty!");
return 1;
}
if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || PlayerInfo != 255)
{
if(PlayerInfo == 0)
        {
            if(IsAFreecop(playerid))
            {
                format(string, sizeof(string), "* Voluntary %s uzima znacku i pistolj iz ormarica.", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 41, 150);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 3, 0);
SetPlayerColor(playerid,0xa9c4e400);
PlayerInfo = 1;
PlayerInfo = 71;
new factionskin = PlayerInfo;
    SetPlayerSkin(playerid, factionskin);
return 1;
}
            if(PlayerInfo == 1 || PlayerInfo == 1)
            {
    format(string, sizeof(string), "* Officer %s uzima znacku i pistolj iz ormarica.", sendername);
    SendClientMessage(playerid, COLOR_WHITE, "Upisi /equip,za opremu!");
    }
else if(PlayerInfo == 2 || PlayerInfo == 2)
            {
    format(string, sizeof(string), "* Agent %s uzima znacku i pistolj iz ormarica.", sendername);
    SendClientMessage(playerid, COLOR_WHITE, "Upisi /equip,za opremu!");
    }
else if(PlayerInfo == 3 || PlayerInfo == 3)
            {
    format(string, sizeof(string), "* Soldier %s uzima znacku i pistolj iz ormarica.", sendername);
    SendClientMessage(playerid, COLOR_WHITE, "Upisi /equip,za opremu!");
}
SendClientMessage(playerid, COLOR_WHITE,"* Ako zelis koristiti i tazer, Koristi /tazer");
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 3, 0);
PlayerInfo = 20;
PlayerInfo = 1;
SetPlayerToTeamColor(playerid);
new factionskin = PlayerInfo;
    SetPlayerSkin(playerid, factionskin);
}
else if(PlayerInfo == 1)
{
    if(IsAFreecop(playerid))
    {
        format(string, sizeof(string), "* Voluntary %s uzima znacku i pistolj iz ormarica.", sendername);
        ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SafeResetPlayerWeapons(playerid);
PlayerInfo = 0;
SetPlayerColor(playerid, TEAM_HIT_COLOR);
new originalskin = PlayerInfo;
    SetPlayerSkin(playerid, originalskin);
return 1;
}
    if(PlayerInfo == 1 || PlayerInfo == 1)
    {
        OnSwatDuty = 0;
format(string, sizeof(string), "* Officer %s stavlja znacku i pistolj u ormaric.", sendername);
}
else if(PlayerInfo == 2 || PlayerInfo == 2)
{
    OnTacticalDuty = 0;
    format(string, sizeof(string), "* Agent %s stavlja znacku i pistolj u ormaric.", sendername);
}
else if(PlayerInfo == 3 || PlayerInfo == 3)
            {
                OnSpecialFDuty = 0;
    format(string, sizeof(string), "* Soldier %s stavlja znacku i pistolj u ormaric.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SafeResetPlayerWeapons(playerid);
SafeSetPlayerArmour(playerid, 0);
SafeGivePlayerWeapon(playerid, 41, 500);
PlayerInfo = 0;
SetPlayerColor(playerid, TEAM_HIT_COLOR);
new originalskin = PlayerInfo;
    SetPlayerSkin(playerid, originalskin);
}
}
else SendClientMessage(playerid, COLOR_GRAD2, "** Nisi u sobi sa ormaricem !");
return 1;
}
else if(PlayerInfo == 4||PlayerInfo == 4)
{
    if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1222.1793,-1246.3489,1287.8243))
    {
        SendClientMessage(playerid, COLOR_GRAD1, "Ti nisi bolnicar!");
        return 1;
}
    if(JobDuty == 1)
    {
        SendClientMessage(playerid, COLOR_WHITE, "* Vise niste na duznosti kao bolnicar.");
        JobDuty = 0;
        Medics -= 1;
        SetPlayerColor(playerid, TEAM_HIT_COLOR);
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "* Sad ste na duznosti kao bolnicar.");
        JobDuty = 1;
        Medics += 1;
    }
}
else if(PlayerInfo == 12||PlayerInfo == 12)
{
    if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2811.7837,-1167.3248,1025.5703))
    {
        SendClientMessage(playerid, COLOR_GRAD1, "Ti nisi vatrogasac!");
        return 1;
}
    if(JobDuty == 1)
    {
        SendClientMessage(playerid, COLOR_WHITE, "* Vise niste na duznosti kao vatrogasac.");
        JobDuty = 0;
        SetPlayerColor(playerid, TEAM_HIT_COLOR);
        SafeResetPlayerWeapons(playerid);
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "* Sad ste na duznosti kao vatrogasac.");
        JobDuty = 1;
SetPlayerColor(playerid, 0xAA333300);
SafeGivePlayerWeapon(playerid, 42, 2500);
SafeGivePlayerWeapon(playerid, 6, 1);
    }
}
else if(PlayerInfo == 17)
  {
      if(JobDuty == 1)
      {
          SendClientMessage(playerid, COLOR_WHITE, "* Ti vise nisi na duznosti i vise neces dobivati pozive za pizza dostavu.");
          JobDuty = 0;
          PizzaBoys -= 1;
      }
      else
      {
          SendClientMessage(playerid, COLOR_WHITE, "* Ti si na duznosti i dobivat ces pozive za pizza dostavu.");
          JobDuty = 1;
        PizzaBoys += 1;
        GetPlayerName(playerid,sendername,sizeof(sendername));
  format(string, sizeof(string), " Pizza Vozac %s je sada na duznosti, /call 111 da narucis pizzu.", sendername);
    OOCNews(0xFF7E00AA,string);
}
}
else if(PlayerInfo == 7)
{
    if(JobDuty == 1)
    {
        SendClientMessage(playerid, COLOR_WHITE, "* Ti vise nisi na duznosti i vise neces dobivati pozive za pomoc.");
        JobDuty = 0;
        Mechanics -= 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "* Ti si na duznosti i dobivat ces pozive za pomoc.");
        JobDuty = 1;
        Mechanics += 1;
        GetPlayerName(playerid,sendername,sizeof(sendername));
  format(string, sizeof(string), " Automehanicar %s je na duznosti, /call 555 da nazoves automehanicara.", sendername);
    OOCNews(0x2993EDAA,string);
    }
}
else SendClientMessage(playerid, COLOR_GRAD1, "  Nisi Policajac !");

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 -> /duty",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}
mikec
Made Man
pre 14 godina
Nisam te najbolje razumeo. Koliko vidim iz skripte, ne bi si trebao moći otići OnDuty na bilokojem mestu. Ali ako možeš ići OnDuty bilogde, a to ne želiš, iz uslova:
if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || PlayerInfo != 255)


Makni ovo zadnje sa pLocal (iako se više ne sećam šta to radi).

Odnosno neka novi uslov izgleda ovako:
if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188))


A ako ne možeš ići bilogde, a želiš bilogde, imenovani uslov zameni da izgleda na sledeći način:
if (1)
GGC
Godfather
pre 14 godina
pLocal, to je varijabla (koja je jako bespotrebna) u GF modu, stavlja se igracu kad ulazi u interior i slicno, to bi bilo nesto kao Virtual World ili nesto slicno..

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava