Podarok Posted January 28, 2011 Report Share Posted January 28, 2011 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 More sharing options...
DeimoN Posted January 28, 2011 Report Share Posted January 28, 2011 (edited) 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 January 28, 2011 by DeimoN Link to comment Share on other sites More sharing options...
Podarok Posted January 28, 2011 Author Report Share Posted January 28, 2011 Lielpaldies! Bet vari lūdzu uzrakstīt to plugina kodu visu kopā , jo es ļoti slikti jēdzu PAWN language) Link to comment Share on other sites More sharing options...
Podarok Posted January 28, 2011 Author Report Share Posted January 28, 2011 Bet vēl viena lieta , tas čalis pieminēja ResetHUD eventu , es tā ka īsti nesapratu kas tas ir , varat lūdzu paskaidrot? Link to comment Share on other sites More sharing options...
DeimoN Posted January 28, 2011 Report Share Posted January 28, 2011 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 More sharing options...
Podarok Posted January 29, 2011 Author Report Share Posted January 29, 2011 (edited) 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 January 29, 2011 by Podarok Link to comment Share on other sites More sharing options...
DeimoN Posted January 29, 2011 Report Share Posted January 29, 2011 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 More sharing options...
Podarok Posted January 29, 2011 Author Report Share Posted January 29, 2011 (edited) Viss staadaa , bet vari ludzu uztaisit augstak to pluginu lai butu kreisaja malaa kkrur pa vidu jo tas pavisam zemu ir. Un ranks radaas visiem 0 ( WTF? Edited January 29, 2011 by Podarok Link to comment Share on other sites More sharing options...
DeimoN Posted January 29, 2011 Report Share Posted January 29, 2011 Dīvaini, StatsX dabū ranku tieši tādā pašā veidā. Kas attiecas uz HUD novietojumu, tad tu to vari mainīt pēc savas izvēles, koriģējot XPOS un YPOS defines. Link to comment Share on other sites More sharing options...
Podarok Posted January 30, 2011 Author Report Share Posted January 30, 2011 Nu piemēram kads jaieliek Xpos un Ypos lai būtu kreisajā sturī kkur biškiņ zemāk nekā pa vidu Link to comment Share on other sites More sharing options...
DeimoN Posted January 30, 2011 Report Share Posted January 30, 2011 XPOS 0.06 YPOS 0.6 Link to comment Share on other sites More sharing options...
Podarok Posted January 30, 2011 Author Report Share Posted January 30, 2011 Bet luudzu paliidzi , tik un taa visiem radaas rank : 0 Link to comment Share on other sites More sharing options...
Podarok Posted January 31, 2011 Author Report Share Posted January 31, 2011 client_putinserver()' date=' it's too soon. Add a small delay.[/quote']Kādā veida to car izdarit??? Link to comment Share on other sites More sharing options...
DeimoN Posted February 1, 2011 Report Share Posted February 1, 2011 #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 More sharing options...
Recommended Posts