Szerző Téma: Bukósisak  (Megtekintve 1126 alkalommal)

Nem elérhető Nátha

  • 1036
    • Profil megtekintése
Bukósisak
« Dátum: 2012. Május 31. - 17:11:07 »
0 Show voters
Üdv
Kellene egy bukósisak script. /sisak-fel parancsra rakja ránk, de úgy hogy jármû nélkül is rajtunk legyen meg ha be szállunk egy kocsiba vagy felülünk egy motorra akkor is rajtunk legyen és /sisak-le paranccsal vegye le.
Elõre is köszönöm !

Nem elérhető CANNONN

  • 2139
    • Profil megtekintése
Bukósisak
« Válasz #1 Dátum: 2012. Június 13. - 15:07:01 »
0 Show voters
#include a_samp
#include zcmd
new rajtavan[MAX_PLAYERS];
CMD:sisak(playerid)
{
if(rajtavan[playerid] == false) return rajtavan[playerid] = true, SetPlayerAttachedObject(playerid, 4, 18645, 2, 0.07, 0.017, 0, 88, 75, 0), SendClientMessage(playerid, 0x0a7800AA, \"Felvetted a bukósisakot.\");
if(rajtavan[playerid] == true) return rajtavan[playerid] = false, RemovePlayerAttachedObject(playerid, 4), SendClientMessage(playerid, 0x0a7800AA, \"Levetted a bukósisakot.\");
return 1;
}

Nem elérhető Nátha

  • 1036
    • Profil megtekintése
Bukósisak
« Válasz #2 Dátum: 2012. Június 14. - 08:34:14 »
0 Show voters
Így csináltam:
 
#include a_samp
#include zcmd
new rajtavan[MAX_PLAYERS];
CMD:sisak(playerid)
{
if(rajtavan[playerid] == false) return rajtavan[playerid] = true, SetPlayerAttachedObject(playerid, 4, 18645, 2, 0.07, 0.017, 0, 88, 75, 0), SendClientMessage(playerid, 0x0a7800AA, \"Felvetted a bukósisakot.\");
if(rajtavan[playerid] == true) return rajtavan[playerid] = false, RemovePlayerAttachedObject(playerid, 4), SendClientMessage(playerid, 0x0a7800AA, \"Levetted a bukósisakot.\");
return 1;
}

 
És 2 warning van benne:
 
C:\\Documents and Settings\\Robi\\Asztal\\0.3e Teszt szerver\\filterscripts\\new.pwn(8) : warning 213: tag mismatch
C:\\Documents and Settings\\Robi\\Asztal\\0.3e Teszt szerver\\filterscripts\\new.pwn(9) : warning 213: tag mismatch
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
2 Warnings.

 
De attól még mûködik tökéletesen csak még is nem lehetne azt a 2 warningot valahogy kijavítani ?
« Utoljára szerkesztve: 2012. Június 14. - 08:42:18 írta Nátha »

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Bukósisak
« Válasz #3 Dátum: 2012. Június 14. - 10:33:21 »
0 Show voters
#include a_samp
#include zcmd
new bool: rajtavan[MAX_PLAYERS];
CMD:sisak(playerid)
{
if(rajtavan[playerid] == false) return rajtavan[playerid] = true, SetPlayerAttachedObject(playerid, 4, 18645, 2, 0.07, 0.017, 0, 88, 75, 0), SendClientMessage(playerid, 0x0a7800AA, \"Felvetted a bukósisakot.\");
if(rajtavan[playerid] == true) return rajtavan[playerid] = false, RemovePlayerAttachedObject(playerid, 4), SendClientMessage(playerid, 0x0a7800AA, \"Levetted a bukósisakot.\");
return 1;
}

Nem elérhető Nátha

  • 1036
    • Profil megtekintése
Bukósisak
« Válasz #4 Dátum: 2012. Június 14. - 10:54:14 »
0 Show voters
Igen így már jó nincsen warning. De felfedeztem rajta valamit, ha rajtam van a sisak és kilépek meg vissza jövök akkor nem lesz rajtam ( ez így jó ), de ha fel akarom venni és be írom hogy /sisak akkor elõbb azt írja Levetted a sisakot. és megint be kell írni hogy fel vegye. Úgy kellene meg csinálni hogyha sisakostól kilépek meg vissza jövök ugyan arra az ID-re akkor ne legyen rajtam a bukósisak.

Nem elérhető SoAP

  • 182
    • Profil megtekintése
Bukósisak
« Válasz #5 Dátum: 2012. Június 14. - 11:48:54 »
0 Show voters
OnPlayerDisconnect(playerid, reason)

 
alá írd be, hogy ha lecsatlakozik a változó értéke legyen megint false

Nem elérhető Nátha

  • 1036
    • Profil megtekintése
Bukósisak
« Válasz #6 Dátum: 2012. Június 14. - 13:02:26 »
0 Show voters
Így ?
 
public OnPlayerDisconnect(playerid, reason)
{
rajtavan[playerid] = false
return 1;
}

Nem elérhető SoAP

  • 182
    • Profil megtekintése
Bukósisak
« Válasz #7 Dátum: 2012. Június 14. - 14:44:12 »
0 Show voters
igen, így próbáld meg.

Nem elérhető Nátha

  • 1036
    • Profil megtekintése
Bukósisak
« Válasz #8 Dátum: 2012. Június 14. - 15:05:50 »
0 Show voters
Thx, mûködik !

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal