Szerző Téma: Kapu más módon  (Megtekintve 518 alkalommal)

Kapu más módon
« Dátum: 2012. Március 09. - 13:37:25 »
0 Show voters
Hali!
Kéne nekem egy olyan kapu ami parancsra nyitódik LuxAdmin tudja használni és 5mp után autómatikusan bezárul. köszzi

Nem elérhető CANNONN

  • 2139
    • Profil megtekintése
Kapu más módon
« Válasz #1 Dátum: 2012. Március 09. - 14:11:39 »
+1 Show voters
new kapu;
public OnGameModeInit()
{
kapu = CreateObject();
        return 1;
}
CMD:nyit(playerid, params[])
{
     if(IsPlayerLuxAdmin(playerid))
        {
          SetTimerEx(\"kaputimer\", 5000, false, \"i\", playerid);
SendClientMessage(playerid,zöldszin,\"A kapu 5 másodperc múlva bezárul!\");
        MoveObject(kapu, x, y, z, 3.0);
        }
        else
        {
        SendClientMessage(playerid, hiba, \"Nem vagy admin!\");
        }
return 1;
}
forward kaputimer(playerid);
public kaputimer(playerid)
{
MoveObject(kapu, x, y, z, 3.0);
return 1;
}
« Utoljára szerkesztve: 2012. Március 09. - 14:26:07 írta Cannonn »

Kapu más módon
« Válasz #2 Dátum: 2012. Március 09. - 16:05:12 »
0 Show voters
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\filterscripts\\LVPD_Kapu.pwn(9) : warning 217: loose indentation
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\filterscripts\\LVPD_Kapu.pwn(32) : warning 203: symbol is never used: \"nyit\"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
2 Warnings.
« Utoljára szerkesztve: 2012. Március 09. - 16:09:01 írta Yakuza™ »

Nem elérhető CANNONN

  • 2139
    • Profil megtekintése
Kapu más módon
« Válasz #3 Dátum: 2012. Március 09. - 16:53:16 »
0 Show voters
Kell hozzá zcmd. Mód elejére írd be, hogy #include zcmd.

Kapu más módon
« Válasz #4 Dátum: 2012. Március 09. - 17:28:14 »
0 Show voters
már mûködik igy kellet:
 
#include <a_samp>
#include <zcmd>
#include <core>
#include <float>
#include <ldudb>
#pragma tabsize 0
new kapu;
#define zöldszin 0x00FF00AA
#define hiba 0xFF0000AA
public OnGameModeInit()
{
kapu = CreateObject(980, 2237.062988, 2453.179443, 13.294235, 0.0000, 0.0000, 270.0000);
return 1;
}
CMD:ny(playerid, params[])
{
     if(IsPlayerLuxAdmin(playerid))
        {
          SetTimerEx(\"kaputimer\", 5000, false, \"i\", playerid);
SendClientMessage(playerid,zöldszin,\"A kapu 5 másodperc múlva bezárul!\");
        MoveObject(kapu, 2237.062988, 2453.179443, 5.894308, 3.0);
        }
        else
        {
        SendClientMessage(playerid, hiba, \"Nem vagy admin!\");
        }
return 1;
}
stock IsPlayerLuxAdmin(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new file[256], tmp, tmp2;
format(file,256,\"/LuxAdmin/Accounts/%s.sav\",udb_encode(name));
tmp = dini_Int(file,\"Level\");
tmp2 = dini_Int(file,\"Loggedin\");
if( (IsPlayerConnected(playerid)) && (tmp > 0) && (tmp2 == 1) )
return true;
else return false;
}
forward kaputimer(playerid);
public kaputimer(playerid)
{
MoveObject(kapu, 2237.062988, 2453.179443, 13.294235, 3.0);
SendClientMessage(playerid,zöldszin,\"A rendõrség kapuja bezárult!\");
return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal