Jump to content
GIGN Forum

Plugin!


Recommended Posts

Labdien visiem))) Vajag Jūsu palīdzību , man vajag uztaisīt tādu pluginu kurš radīs ar HUD msg kad cilvēki pieslēdzās pie servera! Ja pikonektejas parastais spēlētājs tad teksts būs zaļā krāsā , ja admins tad sarkanā , HUD msg ir jābūt (amx_tsay?) vietā un pa rindām , kā piemērā radīs tekstu :

[____] has connected

Current rank is : [____]

Enjoy the server!

Ja parastais players connektojas , tad VISS HUD zaļā krāsā ir , ja admins tad HUD ir sarkanā krāsā.

http://forums.alliedmods.net/showthread.php?t=148674

Tur čalim jau ideja , varbūt tas Jums palīdzēs!

Link to comment
Share on other sites

Tur jau ir iepostots kods. Vienīgi client_putinserver ir jāievieto kāds tasks, lai to HUDu parādītu nedaudz vēlāk.

Ranku var dabūt, izmantojot:


new stats[8], bodyhits[8]

new iRank = get_user_stats(id, stats, bodyhits);

client_print(id, print_chat, "Tavs ranks ir %d", iRank);

Edited by DeimoN
Link to comment
Share on other sites

Neesmu testējis.


#include <amxmodx>

#include <amxmisc>

#include <csx>

#define XPOS 0.15 //HUD pozicija X asii

#define YPOS 0.69 //HUD pozicija Y asii

#define HOLD 6.0 //HUD radisanas ilgums (float)

new gHUD

public plugin_init()

{

register_plugin("viens", "divi", "triis")

gHUD = CreateHudSyncObj()

}

public client_putinserver(id)

{

new szName[33], stats[8], bodyhits[8]

new iRank = get_user_stats(id, stats, bodyhits);

get_user_name(id, szName, charsmax(szName));

set_hudmessage(is_user_admin(id) ? 255 : 0, is_user_admin(id) ? 0 : 255, 0, XPOS, YPOS, 0, 1.5, HOLD);

ShowSyncHudMsg(id, gHUD, "%s has connected^nCurrent Rank is: %d^nEnjoy the server!", szName, iRank)

}

Link to comment
Share on other sites

Nestrada :(((( Message vispar neradas :(

Palidziet ludzu, loti svariigi ar sito ir compile error :


#include <amxmodx>

public plugin_init()

register_plugin("Hello!", "1", "rx1983")

public client_putinserver(id)

{

new Name[32]

get_user_name(id,Name,31)

if (get_user_flags(id) & ADMIN_ADMIN) {

set_hudmessage(0, 255, 0, 0.01, 0.15, 0, 6.0, 12.0)

show_hudmessage(id, "%s has connected ^n WELCOME ADMIN ^n

Current rank is ?% ^n Enjoy the server! " ,Name ?? )

}

if (!(get_user_flags(id) & ADMIN_ADMIN))

{

set_hudmessage(255, 0, 0, 0.01, 0.15, 0, 6.0, 12.0)

show_hudmessage(id, "%s has connected ^n Current rank is ?% ^n Enjoy the server! " ,Name ?? )

}

Edited by Podarok
Link to comment
Share on other sites

Izmēģini šo versiju. Iepriekšējā kodā pieļāvu kļūdu.


#include <amxmodx>

#include <amxmisc>

#include <csx>

#define XPOS 0.15 //HUD pozicija X asii

#define YPOS 0.69 //HUD pozicija Y asii

#define HOLD 6.0 //HUD radisanas ilgums (float)

new gHUD

public plugin_init()

{

register_plugin("viens", "divi", "triis")

gHUD = CreateHudSyncObj()

}

public client_putinserver(id)

{

new szName[33], stats[8], bodyhits[8]

new iRank = get_user_stats(id, stats, bodyhits);

get_user_name(id, szName, charsmax(szName));

set_hudmessage(is_user_admin(id) ? 255 : 0, is_user_admin(id) ? 0 : 255, 0, XPOS, YPOS, 0, 1.5, HOLD);

ShowSyncHudMsg(0, gHUD, "%s has connected^nCurrent Rank is: %d^nEnjoy the server!", szName, iRank)

}

Link to comment
Share on other sites


#include <amxmodx>

#include <amxmisc>

#include <csx>

#define XPOS 0.15 //HUD pozicija X asii

#define YPOS 0.69 //HUD pozicija Y asii

#define HOLD 6.0 //HUD radisanas ilgums (float)

new gHUD

public plugin_init()

{

register_plugin("viens", "divi", "triis")

gHUD = CreateHudSyncObj()

}

public client_putinserver(id)

{

set_task(2.0, "ShowInfo", id)

}

public ShowInfo(id)

{

new szName[33], stats[8], bodyhits[8]

new iRank = get_user_stats(id, stats, bodyhits);

get_user_name(id, szName, charsmax(szName));

set_hudmessage(is_user_admin(id) ? 255 : 0, is_user_admin(id) ? 0 : 255, 0, XPOS, YPOS, 0, 1.5, HOLD);

ShowSyncHudMsg(0, gHUD, "%s has connected^nCurrent Rank is: %d^nEnjoy the server!", szName, iRank)

}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...