public plugin_precache(){ precache_model("models/player/sajmon/sajmon.mdl"); }i próbuje ustawić go graczowi tak:
cs_set_user_model(kto_sajmon,"sajmon");ale nie działa co robię źle?
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.
|
Posted 14.11.2009 23:30
public plugin_precache(){ precache_model("models/player/sajmon/sajmon.mdl"); }i próbuje ustawić go graczowi tak:
cs_set_user_model(kto_sajmon,"sajmon");ale nie działa co robię źle?
Posted 15.11.2009 08:35
Posted 15.11.2009 10:23
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Sajmon" #define VERSION "1.0" #define AUTHOR "DarkGL" new tab[32]; new sajmon_ile=0; new kto_sajmon=0; new kto_sajmon2=0; new ile_rund = 0; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /mesajmon","sajmon"); register_clcmd("say /koniec","koniec_gry"); register_logevent("Poczatek_Rundy", 2, "1=Round_Start") register_logevent("Koniec_Rundy", 2, "1=Round_End") } public plugin_precache(){ precache_model("models/player/sajmon/sajmon.mdl"); } public Koniec_Rundy(){ ile_rund++; } public Poczatek_Rundy(){ if(ile_rund > 0 ){ losuj(); for(new i=0;i<sajmon_ile;i++){ tab[i]=0; } sajmon_ile=0; model_i_reszta(); } } public koniec_gry(id){ if(get_user_team(id) == 2){ if(id == kto_sajmon){ for(new i=1;i<33;i++){ if(is_user_alive(i)){ if(get_user_team(i) == 1){ fnGreenChat(i,"Koniec sajmona"); } else if(get_user_team(i) == 2 || kto_sajmon != i){ fnGreenChat(i,"Koniec sajmona"); } else if (kto_sajmon == i){ fnGreenChat(i,"Zakonczyles gre"); cs_set_user_model(kto_sajmon,"gign"); } } } } } } public sajmon(id){ new byles=0; for(new i=0;i<sajmon_ile;i++){ if(tab[i] == id){ byles = 1; break; } } if(byles == 0){ if(get_user_team(id) == 2){ tab[sajmon_ile]=id; sajmon_ile++; } else { fnGreenChat(id, "Tylko ct moze pisac mesajmon") } } else { fnGreenChat(id, "Sajmon piszesz tylko raz!!") } } public losuj(){ if(sajmon_ile != 0 ){ kto_sajmon2 = random_num(0,sajmon_ile-1) kto_sajmon = tab[kto_sajmon2]; } } public model_i_reszta(){ new name_sajmon[33]; if(kto_sajmon != 0){ if(get_user_team(kto_sajmon) == 2){ get_user_name(kto_sajmon,name_sajmon,sizeof name_sajmon-1); for(new i=1;i<33;i++){ if(is_user_alive(i)){ if(get_user_team(i) == 1){ fnGreenChat(i,"Sluchaj sie tylko %s",name_sajmon); } else if(get_user_team(i) == 2 || kto_sajmon != i){ fnGreenChat(i,"Polecenia wydaje %s",name_sajmon); } else if (kto_sajmon == i){ fnGreenChat(i,"Jestes sajmonem wydawaj polecenia"); fnGreenChat(i,"Mozesz przerwac gre piszac /koniec"); cs_set_user_model(kto_sajmon,"sajmon"); } } } } } else { for(new i=1;i<33;i++){ if(is_user_alive(i)){ if(get_user_team(i) == 1){ fnGreenChat(i,"Nikt nie jest sajmonem!!"); } else if(get_user_team(i) == 2){ fnGreenChat(i,"Nikt nie jest sajmonem !!"); fnGreenChat(i,"Napisz /mesajmon na czacie zeby nim zostac"); } } } } } fnGreenChat( plr, const message[], {Float,Sql,Result,_}:... ) { static max_players, svc_saytext; if( !max_players ) max_players = get_maxplayers( ); if( !svc_saytext ) svc_saytext = get_user_msgid( "SayText" ); static msg[192]; msg[0] = 0x04; vformat( msg[1], sizeof msg - 2, message, 3 ); if( plr > 0 && plr <= max_players ) { message_begin( MSG_ONE, svc_saytext, { 0, 0, 0 }, plr ); write_byte( plr ); write_string( msg ); message_end( ); } else if( plr == 0 ) { for( new i = 1 ; i <= max_players ; i++ ) { if( is_user_connected( i ) ) { message_begin( MSG_ONE, svc_saytext, { 0, 0, 0 }, i ); write_byte( i ); write_string( msg ); message_end( ); } } } return 1; }
Posted 15.11.2009 11:05
get_user_team(i) == 2 && kto_sajmon != i
Posted 15.11.2009 11:07
|?
Posted 15.11.2009 11:10
Posted 15.11.2009 11:11
||oznacza lub jeśli pierwszy warunek jest spełniony to już nie sprawdza 2-giego
0 members, 1 guests, 0 anonymous users