hlmod.hu
https://hlmod.hu/

Admin 30 Nap
https://hlmod.hu/viewtopic.php?f=9&t=29074
Oldal: 1 / 1

Szerző:  KillerBoy12 [ 2018.06.13. 19:35 ]
Hozzászólás témája:  Admin 30 Nap

Üdv!

Itt hogy tudom meg csinálni hogyha meg veszi az admint, akkor 30 napra szól?
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define MAXPLAYERS 33
  5.  
  6. new gPoints[MAXPLAYERS]
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("", "", "")
  11.    
  12.     register_clcmd("say /buy", "Cmd_Admin_Buy")
  13. }
  14. public Cmd_Admin_Buy(PlayerID)
  15. {
  16.     if(gPoints[PlayerID] >= 100)
  17.     {
  18.         //Jog Adás
  19.         client_print(PlayerID, print_chat, "Sikeres vásárlás")
  20.     }
  21.     else client_print(PlayerID, print_chat, "Nincs elég pontod!")
  22. }

Szerző:  Shadow -.- [ 2018.06.13. 20:20 ]
Hozzászólás témája:  Re: Admin 30 Nap

KillerBoy12 írta:
Üdv!

Itt hogy tudom meg csinálni hogyha meg veszi az admint, akkor 30 napra szól?
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define MAXPLAYERS 33
  5.  
  6. new gPoints[MAXPLAYERS]
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("", "", "")
  11.    
  12.     register_clcmd("say /buy", "Cmd_Admin_Buy")
  13. }
  14. public Cmd_Admin_Buy(PlayerID)
  15. {
  16.     if(gPoints[PlayerID] >= 100)
  17.     {
  18.         //Jog Adás
  19.         client_print(PlayerID, print_chat, "Sikeres vásárlás")
  20.     }
  21.     else client_print(PlayerID, print_chat, "Nincs elég pontod!")
  22. }

#include <amxmodx>
#include <amxmisc>

#define MAXPLAYERS 33

new gPoints[MAXPLAYERS]

public plugin_init()
{
register_plugin("", "", "")

register_clcmd("say /buy", "Cmd_Admin_Buy")
}
public Cmd_Admin_Buy(PlayerID)
new adminname[32];
get_user_name(id, adminname, charsmax(adminname));
{
if(gPoints[PlayerID] >= 100)
{
server_cmd("amx_addadmin %s (ide a jogokat! ()-nélkül!"", adminname)
client_print(PlayerID, print_chat, "Sikeres vásárlás")
}
else client_print(PlayerID, print_chat, "Nincs elég pontod!")
}

Eddig tudtam megcsinálni. Ebből gondolom már kitudsz indulni.
new 1.txt(15) : error 003: declaration of a local variable must appear in a compound block
new 1.txt(18) : error 010: invalid function or declaration
new 1.txt(23) : error 010: invalid function or declaration
new 1.txt(24) : warning 203: symbol is never used: "gPoints"

Szerző:  aarpi. [ 2018.06.13. 21:48 ]
Hozzászólás témája:  Re: Admin 30 Nap

KillerBoy12 írta:
Üdv!

Itt hogy tudom meg csinálni hogyha meg veszi az admint, akkor 30 napra szól?
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define MAXPLAYERS 33
  5.  
  6. new gPoints[MAXPLAYERS]
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("", "", "")
  11.    
  12.     register_clcmd("say /buy", "Cmd_Admin_Buy")
  13. }
  14. public Cmd_Admin_Buy(PlayerID)
  15. {
  16.     if(gPoints[PlayerID] >= 100)
  17.     {
  18.         //Jog Adás
  19.         client_print(PlayerID, print_chat, "Sikeres vásárlás")
  20.     }
  21.     else client_print(PlayerID, print_chat, "Nincs elég pontod!")
  22. }

Mentést rá és szerintem működnie kéne normálisan.
Kód:
#include <amxmodx>
#include <amxmisc>

new Pont[33], AdminIdo[33]

public plugin_init()
{
register_clcmd("say /buy", "admin_vesz")
}
public client_connect(id)
{
if(AdminIdo[id] >= 1)
{
set_user_flags(id, read_flags("jogokide"));
}
}
public admin_vesz(id)
{
if(Pont[id] >= 100)
{
AdminIdo[id] += 4816000
Pont[id] -= 100
client_print(id, print_chat, "Sikeres vasarlas!")
}
else
{
client_print(id, print_chat, "Sikertelen vasarlas")
}
}

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/