Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Text ustawiany cvarem nie dziala :// pokazuje 0


  • Zamknięty Temat jest zamknięty
2 odpowiedzi w tym temacie

#1 Grz3sznik

    Życzliwy

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:35
  • Steam:steam
  • Lokalizacja:Gorzów Wlkp.
Offline

Napisano 11.06.2011 10:05

Witom mam taki problem chcę zrobic ze txt ustawia sie cvarem
tzn. nick steam i gg na cvar

linijka: 103


sma:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <ColorChat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"



#define prefix "[ Diller FS ]"
#define prefixs "%hostname%"
#define MoDprefix "[ JailBreak MoD ]"

#define reg_1 "Regulamin pozycja 1"
#define reg_2 "Regulamin pozycja 2"
#define reg_3 "Regulamin pozycja 3"
#define reg_4 "Regulamin pozycja 4"
#define reg_5 "Regulamin pozycja 5"

new gMsgScreenFade

new gCvar_Heroina, gCvar_Kokaina, gCvar_Amfetamina, gCvar_Marihuana, gCvar_LSD, gCvar_Steam, gCvar_Gadu;

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /diller", "DillerIndex");
register_clcmd("say_team /diller", "DillerIndex");

register_clcmd("say /index", "SerwerIndex");
register_clcmd("SerwerIndex", "SerwerIndex");

register_menucmd(register_menuid("SerwerIndex"), 1023, "SerwerIndexClase");
register_menucmd(register_menuid("DillerIndex"), 1023, "DillerIndexClase");

gCvar_Heroina = register_cvar("koszt_heroina", "7500");
gCvar_Kokaina = register_cvar("koszt_kokaina", "8500");
gCvar_Amfetamina = register_cvar("koszt_amfetamina", "4500");
gCvar_Marihuana = register_cvar("koszt_marihuana", "13000");
gCvar_LSD = register_cvar("koszt_lsd", "10000");
gCvar_Steam = register_cvar("netek_steam", "Wpisz w amxx.cfg");
gCvar_Gadu = register_cvar("netek_gg", "Wpisz w amxx.cfg");

// Add your code here...
}

public client_connect(id)
{
client_cmd(id, "bind ^"v^" ^"SerwerIndex^"");
}

public SerwerIndex(id)
{
new gMenuBody[512], len, keys;

len = format(gMenuBody, (sizeof gMenuBody - 1), "\w%s \yGlowne menu:^n",MoDprefix);
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y1.\w Polacz z innym serwerem");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y2.\w Pokaz link forum^n");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y3.\w Ruletka");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y4.\w Diller! \y[\rNoWoSc!\y]^n");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y5.\w Kto jest H@ serwera?");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y6.\w Kontakt z H@^n");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y7.\w Lista Adminow\y[\rNoWoSc!\y]");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y8.\w Kontakt z Adminami!");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y9.\w \rRegulamin \ySerwera \w!");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y0.\w Wyjscie");

keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<5);

show_menu(id, keys, gMenuBody, -1, "SerwerIndexClase");

return 1;
}

public SerwerIndexClase(id, key)
{
switch(key + 1)
{
case 1:
{
ColorChat(id, RED, "%s^x01 Przepraszamy, ale ta funkcja jest^x04 wylaczona^x01.",MoDprefix);
}
case 2:
{
ColorChat(id, RED, "%s^x01 Adres internetowy forum to^x04 www.FullSkill.Xaa.PL^x01",MoDprefix);
}
case 3:
{
client_cmd(id, "say /ruletka" );
}
case 4:
{
DillerIndex(id);
}
case 5:
{
ColorChat(id, RED, "%s^x01 HeadAdmin serwera to^x04 NetekxD^x01.",MoDprefix);
}
case 6:
{
ColorChat(id, RED, "%s^x01 Steam:^x04 %d^x01 Gadu-Gadu:^x04 %d^x01.",MoDprefix ,get_pcvar_num( gCvar_Steam ) ,get_pcvar_num( gCvar_Gadu ) );
}
case 7:
{
ColorChat(id, RED, "%s^x01 Przepraszamy, ale ta funkcja jest^x04 wylaczona^x01.",MoDprefix);
}
case 8:
{
ColorChat(id, RED, "%s^x01 Przepraszamy, ale ta funkcja jest^x04 wylaczona^x01.",MoDprefix);
}
case 9:
{
ZasadyMenu(id);
}
}

return 1;
}

public ZasadyMenu(id)
{
set_hudmessage(255, 0, 0, 0.02, 0.18, 2, 6.0, 7.0, 0.1);
show_hudmessage(id, "Regulamin!^n1. %s^n2. %s^n3. %s^n4. %s^n5. %s^nZapraszamy na Forum", reg_1 ,reg_2 ,reg_3 ,reg_4 ,reg_5 );
}

public DillerIndex(id)
{
new gMenuBody[512], len, keys;

len = format(gMenuBody, (sizeof gMenuBody - 1), "\w%s \yLista narkotykow:^n",prefix);
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y1.\w Marihuana - \r%d\y$", get_pcvar_num( gCvar_Marihuana ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y2.\w LSD - \r%d\y$", get_pcvar_num( gCvar_LSD ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y3.\w Kokaina - \r%d\y$", get_pcvar_num( gCvar_Kokaina ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y4.\w Heroina - \r%d\y$", get_pcvar_num( gCvar_Heroina ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y5.\w Amfetamina - \r%d\y$^n", get_pcvar_num( gCvar_Amfetamina ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y0.\w Wyjscie");

keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<9);

show_menu(id, keys, gMenuBody, -1, "DillerIndexClase");

return 1;
}

public DillerIndexClase(id, key)
{
switch(key + 1)
{
case 1:
{
Marysia(id);
}
case 2:
{
//ShowPlayerInfoMenu(id);
}
case 3:
{
//Sho/
}
case 4:
{
//
}
case 5:
{
//
}
}

return 1;
}

public Marysia(id)
{
message_begin(MSG_ONE,gMsgScreenFade,{0,0,0},id)
write_short( 6*(1<<12) ) //duration
write_short( 2*(1<<12) ) //hold time
write_short( 0x0000 ) //flags
write_byte( 0 ) // RRR
write_byte( 255 ) // GGG
write_byte( 0 ) // BBB
write_byte( 0 ) // Alpha
message_end()
}


daje ++
  • +
  • -
  • 0

#2 Goliath

    Godlike

  • Przyjaciel

Reputacja: 1 237
Godlike

  • Postów:2 334
  • GG:
  • Steam:steam
  • Imię:Maciej
  • Lokalizacja:Mońki
Offline

Napisano 11.06.2011 10:16

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <ColorChat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"



#define prefix "[ Diller FS ]"
#define prefixs "%hostname%"
#define MoDprefix "[ JailBreak MoD ]"

#define reg_1 "Regulamin pozycja 1"
#define reg_2 "Regulamin pozycja 2"
#define reg_3 "Regulamin pozycja 3"
#define reg_4 "Regulamin pozycja 4"
#define reg_5 "Regulamin pozycja 5"

new gMsgScreenFade

new gCvar_Heroina, gCvar_Kokaina, gCvar_Amfetamina, gCvar_Marihuana, gCvar_LSD, gCvar_Steam, gCvar_Gadu;

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /diller", "DillerIndex");
register_clcmd("say_team /diller", "DillerIndex");

register_clcmd("say /index", "SerwerIndex");
register_clcmd("SerwerIndex", "SerwerIndex");

register_menucmd(register_menuid("SerwerIndex"), 1023, "SerwerIndexClase");
register_menucmd(register_menuid("DillerIndex"), 1023, "DillerIndexClase");

gCvar_Heroina = register_cvar("koszt_heroina", "7500");
gCvar_Kokaina = register_cvar("koszt_kokaina", "8500");
gCvar_Amfetamina = register_cvar("koszt_amfetamina", "4500");
gCvar_Marihuana = register_cvar("koszt_marihuana", "13000");
gCvar_LSD = register_cvar("koszt_lsd", "10000");
gCvar_Steam = register_cvar("netek_steam", "Wpisz w amxx.cfg");
gCvar_Gadu = register_cvar("netek_gg", "Wpisz w amxx.cfg");

// Add your code here...
}

public client_connect(id)
{
client_cmd(id, "bind ^"v^" ^"SerwerIndex^"");
}

public SerwerIndex(id)
{
new gMenuBody[512], len, keys;

len = format(gMenuBody, (sizeof gMenuBody - 1), "\w%s \yGlowne menu:^n",MoDprefix);
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y1.\w Polacz z innym serwerem");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y2.\w Pokaz link forum^n");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y3.\w Ruletka");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y4.\w Diller! \y[\rNoWoSc!\y]^n");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y5.\w Kto jest H@ serwera?");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y6.\w Kontakt z H@^n");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y7.\w Lista Adminow\y[\rNoWoSc!\y]");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y8.\w Kontakt z Adminami!");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y9.\w \rRegulamin \ySerwera \w!");
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y0.\w Wyjscie");

keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<5);

show_menu(id, keys, gMenuBody, -1, "SerwerIndexClase");

return 1;
}

public SerwerIndexClase(id, key)
{
switch(key + 1)
{
case 1:
{
ColorChat(id, RED, "%s^x01 Przepraszamy, ale ta funkcja jest^x04 wylaczona^x01.",MoDprefix);
}
case 2:
{
ColorChat(id, RED, "%s^x01 Adres internetowy forum to^x04 www.FullSkill.Xaa.PL^x01",MoDprefix);
}
case 3:
{
client_cmd(id, "say /ruletka" );
}
case 4:
{
DillerIndex(id);
}
case 5:
{
ColorChat(id, RED, "%s^x01 HeadAdmin serwera to^x04 NetekxD^x01.",MoDprefix);
}
case 6:
{
new gg[10], steam[30];
get_pcvar_string(gCvar_Gadu, gg, 9);
get_pcvar_string(gCvar_Steam, steam, 29);
ColorChat(id, RED, "%s^x01 Steam:^x04 %d^x01 Gadu-Gadu:^x04 %d^x01.",MoDprefix, gg, steam);
}
case 7:
{
ColorChat(id, RED, "%s^x01 Przepraszamy, ale ta funkcja jest^x04 wylaczona^x01.",MoDprefix);
}
case 8:
{
ColorChat(id, RED, "%s^x01 Przepraszamy, ale ta funkcja jest^x04 wylaczona^x01.",MoDprefix);
}
case 9:
{
ZasadyMenu(id);
}
}

return 1;
}

public ZasadyMenu(id)
{
set_hudmessage(255, 0, 0, 0.02, 0.18, 2, 6.0, 7.0, 0.1);
show_hudmessage(id, "Regulamin!^n1. %s^n2. %s^n3. %s^n4. %s^n5. %s^nZapraszamy na Forum", reg_1 ,reg_2 ,reg_3 ,reg_4 ,reg_5 );
}

public DillerIndex(id)
{
new gMenuBody[512], len, keys;

len = format(gMenuBody, (sizeof gMenuBody - 1), "\w%s \yLista narkotykow:^n",prefix);
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y1.\w Marihuana - \r%d\y$", get_pcvar_num( gCvar_Marihuana ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y2.\w LSD - \r%d\y$", get_pcvar_num( gCvar_LSD ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y3.\w Kokaina - \r%d\y$", get_pcvar_num( gCvar_Kokaina ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y4.\w Heroina - \r%d\y$", get_pcvar_num( gCvar_Heroina ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y5.\w Amfetamina - \r%d\y$^n", get_pcvar_num( gCvar_Amfetamina ) );
len += format(gMenuBody[len], (sizeof gMenuBody - 1) - len, "^n\y0.\w Wyjscie");

keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<9);

show_menu(id, keys, gMenuBody, -1, "DillerIndexClase");

return 1;
}

public DillerIndexClase(id, key)
{
switch(key + 1)
{
case 1:
{
Marysia(id);
}
case 2:
{
//ShowPlayerInfoMenu(id);
}
case 3:
{
//Sho/
}
case 4:
{
//
}
case 5:
{
//
}
}

return 1;
}

public Marysia(id)
{
message_begin(MSG_ONE,gMsgScreenFade,{0,0,0},id)
write_short( 6*(1<<12) ) //duration
write_short( 2*(1<<12) ) //hold time
write_short( 0x0000 ) //flags
write_byte( 0 ) // RRR
write_byte( 255 ) // GGG
write_byte( 0 ) // BBB
write_byte( 0 ) // Alpha
message_end()
}

Jak się pobiera wartość liczbową z cvaru tekstowego to się tak ma...
  • +
  • -
  • 1

#3 Grz3sznik

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:35
  • Steam:steam
  • Lokalizacja:Gorzów Wlkp.
Offline

Napisano 11.06.2011 10:19

teraz mam zamiast 0 87 w kazdym ... ;D

Użytkownik Grz3sznik edytował ten post 11.06.2011 10:20

  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych