Szerző Téma: Több pozíción való használat  (Megtekintve 645 alkalommal)

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Több pozíción való használat
« Dátum: 2012. november 12. - 18:58:34 »
0 Show voters
Sziasztok.
Azt szeretném kérdezni, hogyan lehet megcsinálni, hogy egy parancsot ne csak 1, hanem több helyen is tudjunk alkalmazni? Próbáltam egymás alá írni így:
 
   if (strcmp(\"/Test\", cmdtext, true, 10) == 0)
    {
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270))
        if(IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270))

 
De nem jó (Nem error, csak nem mûködik akkor a parancs. Azért ugyanaz a 2 pozíció, mert csak példaként írom ide).
A parancs így néz ki:
 
   if (strcmp(\"/Test\", cmdtext, true, 10) == 0)
    {
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270))
{
          //Itt a parancs végrehajtása
}
else SendClientMessage(playerid, 0xFF0000AA, \"Nem vagy a pozíción!\");
return 1;

 
Hogyan tudom ebbõl kihozni azt, hogy több helyen is lehessen használni?

Nem elérhető Kovacs_Richard

  • 1743
  • HRP Fejlesztő
  • Discord: Kovacs_Richard#0321
    • Profil megtekintése
    • Hun Role Play Web
Több pozíción való használat
« Válasz #1 Dátum: 2012. november 12. - 19:00:11 »
0 Show voters
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270) || IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270))
Régóta nem tevékenykedem, mint SA-MP scripter.
HRP Fejlesztő.

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Több pozíción való használat
« Válasz #2 Dátum: 2012. november 12. - 21:45:18 »
0 Show voters
Idézetet írta: Kovacs_Richard date=1352743211\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"29783\" data-ipsquote-contentclass=\"forums_Topic

if(IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270) || IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270))

 

Köszi, ez jó, viszont 2 warningot ír. Tudom, nem baj, de idegesít. Miért? 4 pozícíóra használtam így:
 
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270) || IsPlayerInRangeOfPoint (playerid, 5.0, 1867.8964,-3533.5127,7.3043 || IsPlayerInRangeOfPoint(playerid, 5.0, 1813.9010,-3463.3311,11.9739 || IsPlayerInRangeOfPoint(playerid, 5.0, 1869.0693,-3533.8560,7.3919))))

 
A warningok:
 
D:\\Játékok\\GTA\\Island\\gamemodes\\Island.pwn(298) : warning 213: tag mismatch
D:\\Játékok\\GTA\\Island\\gamemodes\\Island.pwn(298) : warning 213: tag mismatch
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
2 Warnings.

Nem elérhető Kovacs_Richard

  • 1743
  • HRP Fejlesztő
  • Discord: Kovacs_Richard#0321
    • Profil megtekintése
    • Hun Role Play Web
Több pozíción való használat
« Válasz #3 Dátum: 2012. november 12. - 21:53:42 »
0 Show voters
))))

 
pakold a helyükre ezeket :D
Régóta nem tevékenykedem, mint SA-MP scripter.
HRP Fejlesztő.

Több pozíción való használat
« Válasz #4 Dátum: 2012. november 12. - 22:50:48 »
+1 Show voters
    if(   
IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270) ||
IsPlayerInRangeOfPoint(playerid, 5.0, 1867.8964,-3533.5127,7.3043) ||
IsPlayerInRangeOfPoint(playerid, 5.0, 1813.9010,-3463.3311,11.9739) ||
IsPlayerInRangeOfPoint(playerid, 5.0, 1869.0693,-3533.8560,7.3919)
)

 
Hátha így jobban látható az egész. :D

Nem elérhető Petrik

  • 318
    • Profil megtekintése
Több pozíción való használat
« Válasz #5 Dátum: 2012. november 13. - 14:23:27 »
0 Show voters
Idézetet írta: ɐʞzssǝlosz date=1352757048\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"29783\" data-ipsquote-contentclass=\"forums_Topic

    if(   
IsPlayerInRangeOfPoint(playerid, 5.0, 1815.6116,-3563.2478,7.1270) ||
IsPlayerInRangeOfPoint(playerid, 5.0, 1867.8964,-3533.5127,7.3043) ||
IsPlayerInRangeOfPoint(playerid, 5.0, 1813.9010,-3463.3311,11.9739) ||
IsPlayerInRangeOfPoint(playerid, 5.0, 1869.0693,-3533.8560,7.3919)
)

 
Hátha így jobban látható az egész. :D
 
Köszönöm! :)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal