Szerző Téma: PlayerToPoint probléma  (Megtekintve 987 alkalommal)

PlayerToPoint probléma
« Dátum: 2018. Május 08. - 11:19:07 »
0
Szervusztok! Egy ideje gyakorolgatom a pawn programozást (nyilván az itteni kód is amit bemásolom nem saját hanem próbálom a lehető legjobban átalakitani) A következő volna a problémám
 
[pawn]        else if(egyezik(param[1],\"lead\") || egyezik(param[1],\"lead\"))
        {
            if(Dolgozik[playerid] != MUNKA_PIZZAFUTAR) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Nem vettél fel megrendelést!\");
            if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Járműből nem adhatod le!\");
            new cp, Float:x, Float:y, Float:z;
            {
                cp = random(sizeof(PizzafutarCheckpointok));
                x = PizzafutarCheckpointok[cp][0];
                y = PizzafutarCheckpointok[cp][1];
                z = PizzafutarCheckpointok[cp][2];
                new penz = Rand(7,18);
                format(string, sizeof(string), \"~g~Jutalmad: $%d\", penz);
                GameTextForPlayer(playerid, string, 2500, 4);
                SendClientMessage(playerid, COLOR_YELLOW, \"[Munka - Pizzafutár]: Átadtad a pizzát a megrendelőnek!\");
                AdPenz(playerid,penz);
                SetPlayerCheckpoint(playerid, x,y,z, 5);[/pawn]
 
 
 
Adott ez a kód. Hogyan tudnám megoldani, hogyha nincs a checkpointba akkor ne engedj használni a parancsot? Próbáltam már mindenhogy itt ülök felette lassan kettő órája de nem tudok rájönni :D Maga az egész munka tökéletesen működi kivéve az, hogy egy helyben állva floodolhatom a lead parancsot és kapom folyton a pénzt :D

PlayerToPoint probléma
« Válasz #1 Dátum: 2018. Május 08. - 14:13:22 »
0

else if(egyezik(param[1],\"lead\") || egyezik(param[1],\"lead\"))
        {
            if(Dolgozik[playerid] != MUNKA_PIZZAFUTAR) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Nem vettél fel megrendelést!\");
            if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Járműből nem adhatod le!\");
            new cp, Float:x, Float:y, Float:z;
      if(IsPlayerInRangeOfPoint(playerid,4.0,x,y,z))
            {
                cp = random(sizeof(PizzafutarCheckpointok));
                x = PizzafutarCheckpointok[cp][0];
                y = PizzafutarCheckpointok[cp][1];
                z = PizzafutarCheckpointok[cp][2];
                new penz = Rand(7,18);
                format(string, sizeof(string), \"~g~Jutalmad: $%d\", penz);
                GameTextForPlayer(playerid, string, 2500, 4);
                SendClientMessage(playerid, COLOR_YELLOW, \"[Munka - Pizzafutár]: Átadtad a pizzát a megrendelőnek!\");
                AdPenz(playerid,penz);
                SetPlayerCheckpoint(playerid, x,y,z, 5);
      }
      else
      {
         return 1;
      }
   }

 
 

PlayerToPoint probléma
« Válasz #2 Dátum: 2018. Május 08. - 14:32:22 »
0
Nemsokára tesztelem, köszi!

PlayerToPoint probléma
« Válasz #3 Dátum: 2018. Május 08. - 14:44:00 »
0
Nem jó! Ugyanúgy akárhol vagyok odaadja a pénzt!     :/
 
 
 
else if(egyezik(param[1],\"lead\") || egyezik(param[1],\"lead\"))
        {
            if(Dolgozik[playerid] != MUNKA_PIZZAFUTAR) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Nem vettél fel megrendelést!\");
            if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Járműből nem adhatod le!\");
            new cp, Float:x, Float:y, Float:z;
            if(IsPlayerInRangeOfPoint(playerid,4.0,x,y,z)) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Nem ide szól a megrendelés!\");
            {
                cp = random(sizeof(PizzafutarCheckpointok));
                x = PizzafutarCheckpointok[cp][0];
                y = PizzafutarCheckpointok[cp][1];
                z = PizzafutarCheckpointok[cp][2];
                new penz = Rand(7,18);
                format(string, sizeof(string), \"~g~Jutalmad: $%d\", penz);
                GameTextForPlayer(playerid, string, 2500, 4);
                SendClientMessage(playerid, COLOR_YELLOW, \"[Munka - Pizzafutár]: Átadtad a pizzát a megrendelőnek!\");
                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                AdPenz(playerid,penz);
                SetPlayerCheckpoint(playerid, x,y,z, 5);
                return 1
            }
        }
        return 1;
    }
« Utoljára szerkesztve: 2018. Május 08. - 14:46:28 írta ILuvCoffe »

PlayerToPoint probléma
« Válasz #4 Dátum: 2018. Május 08. - 21:25:45 »
0
else if(egyezik(param[1],\"lead\") || egyezik(param[1],\"lead\"))
        {
            if(Dolgozik[playerid] != MUNKA_PIZZAFUTAR) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Nem vettél fel megrendelést!\");
            if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Járműből nem adhatod le!\");
            new cp, Float:x, Float:y, Float:z;
            if(IsPlayerInRangeOfPoint(playerid,4.0,x,y,z))
            {
                SendClientMessage(playerid, COLOR_RED, \"[Munka - Pizzafutár]: Nem ide szól a megrendelés!\");
            }
            else
            {
                cp = random(sizeof(PizzafutarCheckpointok));
                x = PizzafutarCheckpointok[cp][0];
                y = PizzafutarCheckpointok[cp][1];
                z = PizzafutarCheckpointok[cp][2];
                new penz = Rand(7,18);
                format(string, sizeof(string), \"~g~Jutalmad: $%d\", penz);
                GameTextForPlayer(playerid, string, 2500, 4);
                SendClientMessage(playerid, COLOR_YELLOW, \"[Munka - Pizzafutár]: Átadtad a pizzát a megrendelőnek!\");
                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                AdPenz(playerid,penz);
                SetPlayerCheckpoint(playerid, x,y,z, 5);
                return 1;
            }
        }

PlayerToPoint probléma
« Válasz #5 Dátum: 2018. Május 09. - 06:38:41 »
0
Továbbra sem jó. Bárhol le tudom adni :D 
 
Picsu elküldtem pm-ben az egész pizzás kódot!
 
 
 
 
« Utoljára szerkesztve: 2018. Május 09. - 06:40:53 írta ILuvCoffe »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal