Szerző Téma: Parancs hiba!!  (Megtekintve 660 alkalommal)

Parancs hiba!!
« Dátum: 2011. November 30. - 13:31:26 »
0 Show voters
Üdv mindenkinek!
Van itt egy parancs aminek az lenne a dolga hogy a vehetõ kocsikat új helyre leparkolja csak, hogy nem akar ennek eleget tenni..
Ezért kérem a segítségeteket.. Leíroma a történetet: Tehát odébb viszem a jármûvet és beírom, hogy /leparkol ekkor az történik hogy a kocsi eltûnik.......és amikor újraindítom a szervert akkor meg ugyanott van, ahol volt, tehát semmi nem történt.
Bemásolom a parancsot:
[pawn]if(strcmp(cmd, \"/leparkol\", true) == 0)
{
    if(Admin(playerid, 1) || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17)
   {
       new kocsiidx = GetClosestCar(playerid);
       if(kocsiidx >= 136)
       {
           new Float:health;
         new Float:x,Float:y,Float:z;
         new Float:a;
         GetVehicleHealth(kocsiidx, health);
         GetVehiclePos(kocsiidx, x, y, z);
         GetPlayerFacingAngle(playerid, a);
         GetVehicleZAngle(kocsiidx, a);
         CarInfo[kocsiidx][cLocationx] = x;
         CarInfo[kocsiidx][cLocationy] = y;
         CarInfo[kocsiidx][cLocationz] = z;
         CarInfo[kocsiidx][cAngle] = a;
         OnPropUpdate();
         OnPlayerUpdate(playerid);
          DestroyVehicle(kocsiidx);
             CreateVehicle(CarInfo[kocsiidx][cModel],CarInfo[kocsiidx][cLocationx],CarInfo[kocsiidx][cLocationy],CarInfo[kocsiidx][cLocationz]+1.0,CarInfo[kocsiidx][cAngle],CarInfo[kocsiidx][cColorOne],CarInfo[kocsiidx][cColorTwo],60000);
           SetVehicleHealth(kocsiidx, health);
           SendClientMessage(playerid,0xFFFF00AA, \"leparkoltad a melletted álló jármûvet!\");
       } else SendClientMessage(playerid,COLOR_GRAD2,\"Ezt a jármûvet nem parkolhatod le!\");
   } else return SendClientMessage(playerid,COLOR_GRAD2, \"Nem vagy szerelõ!\");
   return 1;
}[/pawn]
Remélem valaki megtudja oldani ezt a problémát mivel nekem nem sikerült, bárhogy próbáltam...
A segítségeteket elõre is köszönöm....
By: Atyo

Nem elérhető Axe9

  • 131
    • Profil megtekintése
Parancs hiba!!
« Válasz #1 Dátum: 2011. November 30. - 14:05:33 »
0 Show voters
Szia!
Nem látom hogy mi lenne benne a probléma de próbáld meg evvel:
Vagyis a hibádat is megtaláltam ha jól látom.: [pawn]if(kocsiidx >= 136)[/pawn] ennek 199-nek kell lennie!
[pawn]if(strcmp(cmd, \"/leparkol\", true) == 0)
{
    if(Admin(playerid, 1) || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17)
   {
       new kocsiidx = GetClosestCar(playerid);
       if(kocsiidx >= 199)
       {
           new Float:health;
         new Float:x,Float:y,Float:z;
         new Float:a;
         GetVehicleHealth(kocsiidx, health);
         GetVehiclePos(kocsiidx, x, y, z);
         GetPlayerFacingAngle(playerid, a);
         GetVehicleZAngle(kocsiidx, a);
         CarInfo[kocsiidx][cLocationx] = x;
         CarInfo[kocsiidx][cLocationy] = y;
         CarInfo[kocsiidx][cLocationz] = z;
         CarInfo[kocsiidx][cAngle] = a;
         OnPropUpdate();
         OnPlayerUpdate(playerid);
          DestroyVehicle(kocsiidx);
          CreateVehicle(CarInfo[kocsiidx][cModel],CarInfo[kocsiidx][cLocationx],CarInfo[kocsiidx][cLocationy],CarInfo[kocsiidx][cLocationz]+1.0,CarInfo[kocsiidx][cAngle],CarInfo[kocsiidx][cColorOne],CarInfo[kocsiidx][cColorTwo],60000);
           SetVehicleHealth(kocsiidx, health);
           SendClientMessage(playerid,0xFFFF00AA, \"Beparkoltad a melletted álló jármûvet!\");
       } else SendClientMessage(playerid,COLOR_GRAD2,\"Ezt a jármûvet nem parkolhatod le!\");
   } else return SendClientMessage(playerid,COLOR_GRAD2, \"Nem vagy szerelõ!\");
   return 1;
}[/pawn]
« Utoljára szerkesztve: 2011. November 30. - 14:07:50 írta Axe9 »

Parancs hiba!!
« Válasz #2 Dátum: 2011. November 30. - 14:17:29 »
0 Show voters
Idézetet írta: Axe9 date=1322658333\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"13836\" data-ipsquote-contentclass=\"forums_Topic
Szia!
Nem látom hogy mi lenne benne a probléma de próbáld meg evvel:
Vagyis a hibádat is megtaláltam ha jól látom.: [pawn]if(kocsiidx >= 136)[/pawn] ennek 199-nek kell lennie!
[pawn]if(strcmp(cmd, \"/leparkol\", true) == 0)
{
    if(Admin(playerid, 1) || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 17)
   {
       new kocsiidx = GetClosestCar(playerid);
       if(kocsiidx >= 199)
       {
           new Float:health;
         new Float:x,Float:y,Float:z;
         new Float:a;
         GetVehicleHealth(kocsiidx, health);
         GetVehiclePos(kocsiidx, x, y, z);
         GetPlayerFacingAngle(playerid, a);
         GetVehicleZAngle(kocsiidx, a);
         CarInfo[kocsiidx][cLocationx] = x;
         CarInfo[kocsiidx][cLocationy] = y;
         CarInfo[kocsiidx][cLocationz] = z;
         CarInfo[kocsiidx][cAngle] = a;
         OnPropUpdate();
         OnPlayerUpdate(playerid);
          DestroyVehicle(kocsiidx);
          CreateVehicle(CarInfo[kocsiidx][cModel],CarInfo[kocsiidx][cLocationx],CarInfo[kocsiidx][cLocationy],CarInfo[kocsiidx][cLocationz]+1.0,CarInfo[kocsiidx][cAngle],CarInfo[kocsiidx][cColorOne],CarInfo[kocsiidx][cColorTwo],60000);
           SetVehicleHealth(kocsiidx, health);
           SendClientMessage(playerid,0xFFFF00AA, \"Beparkoltad a melletted álló jármûvet!\");
       } else SendClientMessage(playerid,COLOR_GRAD2,\"Ezt a jármûvet nem parkolhatod le!\");
   } else return SendClientMessage(playerid,COLOR_GRAD2, \"Nem vagy szerelõ!\");
   return 1;
}[/pawn]
 
Az véletlenszerûen sem hiba mivel én újraraktam az összes kocsit és a felesleget kidobtam, az a szám csak azt jelzi hogy hanyas ID-tõl vannak a vehetõ kocsik....

Parancs hiba!!
« Válasz #3 Dátum: 2011. December 03. - 21:08:32 »
0 Show voters
Na senkisem tudja orvosolni a problémámat???

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal