case 21: case 22:poprawnie>>
case 21, 22:
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.
|
Napisano 25.08.2009 15:07
case 21: case 22:poprawnie>>
case 21, 22:
Napisano 26.08.2009 15:21
Napisano 26.08.2009 15:31
#define ASD
switch(bron_id)
{
case 6,4,9,25,29,1,10,11,16,17,26,23,7,19,12:
{
set_user_maxspeed(id,250.0+100.0)
speed[id] = 4.0;
}
case 30:
{
set_user_maxspeed(id,248.0+100.0)
speed[id] = 4.0;
}
case 5,15,14,8:
{
set_user_maxspeed(id,240.0+100.0)
speed[id] = 4.0;
}
case 27:
{
set_user_maxspeed(id,235.0+100.0)
speed[id] = 4.0;
}
case 21,22:
{
set_user_maxspeed(id,230.0+100.0)
speed[id] = 4.0;
}
case 28,20:
{
set_user_maxspeed(id,220.0+100.0)
speed[id] = 4.0;
}
case 13,24,18:
{
set_user_maxspeed(id,210.0+100.0)
speed[id] = 4.0;
}
case 3:
{
set_user_maxspeed(id,260.0+100.0)
speed[id] = 4.0;
}
}
co Napisano 26.08.2009 21:37
Napisano 26.08.2009 22:11
dlaczego? mało optymalne, ale da się skompilować i powinno działać użyte w odpowiednim miejscu (CurWeapon)raczej nie
new const Float:gfCSSpeeds[]={
000.0,
250.0, 000.0, 260.0, 250.0, 240.0,
250.0, 250.0, 240.0, 250.0, 250.0,
250.0, 250.0, 210.0, 240.0, 240.0,
250.0, 250.0, 210.0, 250.0, 220.0,
230.0, 230.0, 250.0, 210.0, 250.0,
250.0, 235.0, 221.0, 250.0, 245.0
}i potemnew Float:fNowaPredkosc=gfCSSpeeds[bron_id]+100.0;
Napisano 27.08.2009 08:22
Napisano 27.08.2009 08:37
Napisano 27.08.2009 08:39
bron_id=cs_get_weapon_id(id) set_user_maxspeed(id,gfCSSpeeds[bron_id]+75.0)ale gdy zrobię tak :
set_user_maxspeed(id,325.0) bron_id=cs_get_weapon_id(id)to działa czyli robię coś źle w tej linijce :
bron_id=cs_get_weapon_id(id)tylko co
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <fakemeta>
#include <cstrike>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Home"
#define MYMENU_KEYS MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4
new speed_jest_na_runde = 1 // 1 - tak 0 - nie
new speed[33];
new one_cost
new two_cost
new three_cost
new four_cost
new bron_id
new const Float:gfCSSpeeds[]={
000.0,
250.0, 000.0, 260.0, 250.0, 240.0,
250.0, 250.0, 240.0, 250.0, 250.0,
250.0, 250.0, 210.0, 240.0, 240.0,
250.0, 250.0, 210.0, 250.0, 220.0,
230.0, 230.0, 250.0, 210.0, 250.0,
250.0, 235.0, 221.0, 250.0, 245.0
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event( "CurWeapon", "Event_Change_Weapon", "be", "1=1" );
register_logevent("Koniec_Rundy", 2, "1=Round_End")
register_clcmd("say /rate","menu")
register_menu("FirstMenu",MYMENU_KEYS,"menu2");
set_cvar_num("sv_maxspeed", 360);
one_cost = register_cvar("one_cost","2500")
two_cost = register_cvar("two_cost","5000")
three_cost = register_cvar("three_cost","7500")
four_cost = register_cvar("four_cost","10000")
}
public client_connect(id)
{
speed[id] = 0
}
public Event_Change_Weapon(id){
bron_id=cs_get_weapon_id(id)
if(speed[id] == 0)
{
set_user_maxspeed(id,gfCSSpeeds[bron_id])
}
if(speed[id] == 1)
{
set_user_maxspeed(id,gfCSSpeeds[bron_id]+25.0)
}
if(speed[id] == 2)
{
set_user_maxspeed(id,gfCSSpeeds[bron_id]+50.0)
}
if(speed[id] == 3)
{
set_user_maxspeed(id,gfCSSpeeds[bron_id]+75.0)
}
if(speed[id] == 4)
{
set_user_maxspeed(id,gfCSSpeeds[bron_id]+100.0)
}
}
public Koniec_Rundy(id){
if(speed_jest_na_runde){
bron_id=cs_get_weapon_id(id)
for(new id; id<33; id++){
if(is_user_connected(id)){
set_user_maxspeed(id,gfCSSpeeds[bron_id])
}
}
}
}
public menu(id){
show_menu(id,MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4,"yRate Menu^n^nw1. +25^n2. +50^n3. +75^n4. +100",-1,"FirstMenu");
return PLUGIN_HANDLED
}
public menu2(id,key)
{
switch(key)
{
case 0:
{
one(id);
}
case 1:
{
two(id);
}
case 2:
{
three(id);
}
case 3:
{
four(id);
}
}
}
public one(id)
{
if(is_user_alive(id)==0)
{
client_print(id,print_chat,"Nie żyjesz!")
return PLUGIN_HANDLED
}
if(cs_get_user_money(id)<=get_pcvar_num(one_cost))
{
client_print(id,print_chat,"Masz za mało kasy!")
return PLUGIN_HANDLED
}
cs_set_user_money(id,cs_get_user_money(id)-get_pcvar_num(one_cost))
bron_id=cs_get_weapon_id(id)
set_user_maxspeed(id,gfCSSpeeds[bron_id]+25.0)
return PLUGIN_HANDLED
}
public two(id)
{
if(is_user_alive(id)==0)
{
client_print(id,print_chat,"Nie żyjesz!")
return PLUGIN_HANDLED
}
if(cs_get_user_money(id)<=get_pcvar_num(two_cost))
{
client_print(id,print_chat,"Masz za mało kasy!")
return PLUGIN_HANDLED
}
cs_set_user_money(id,cs_get_user_money(id)-get_pcvar_num(two_cost))
bron_id=cs_get_weapon_id(id)
set_user_maxspeed(id,gfCSSpeeds[bron_id]+50.0)
return PLUGIN_HANDLED
}
public three(id)
{
if(is_user_alive(id)==0)
{
client_print(id,print_chat,"Nie żyjesz!")
return PLUGIN_HANDLED
}
if(cs_get_user_money(id)<=get_pcvar_num(three_cost))
{
client_print(id,print_chat,"Masz za mało kasy!")
return PLUGIN_HANDLED
}
cs_set_user_money(id,cs_get_user_money(id)-get_pcvar_num(three_cost))
bron_id=cs_get_weapon_id(id)
set_user_maxspeed(id,gfCSSpeeds[bron_id]+75.0)
return PLUGIN_HANDLED
}
public four(id)
{
if(is_user_alive(id)==0)
{
client_print(id,print_chat,"Nie żyjesz!")
return PLUGIN_HANDLED
}
if(cs_get_user_money(id)<=get_pcvar_num(four_cost))
{
client_print(id,print_chat,"Masz za mało kasy!")
return PLUGIN_HANDLED
}
cs_set_user_money(id,cs_get_user_money(id)-get_pcvar_num(four_cost))
bron_id=cs_get_weapon_id(id)
set_user_maxspeed(id,gfCSSpeeds[bron_id]+100.0)
return PLUGIN_HANDLED
}
Napisano 27.08.2009 16:54
cs_get_weapon_id ( index )
Notes:
index is the entity index of the weapon
Napisano 27.08.2009 16:57
read_data(2)
Napisano 27.08.2009 17:11
bron=read_data(2)kompilować się kompiluje ale działać niet
Napisano 27.08.2009 17:25
Napisano 27.08.2009 17:26
Napisano 27.08.2009 17:35
0 użytkowników, 0 gości, 0 anonimowych