Problem przy dodaniu klasy
bas233 17.08.2015
Witam chciałem dodać klasę kameleon i żeby miała to samo co klasa szpieg doszedłem do tego momentu i skopiowałem szpiega i zmieniłem nic i wywala pełno errorów .
switch(informacje_itemu_gracza[client][0]) { case 4: informacje_itemu_gracza[client][1] = 1; case 14: informacje_itemu_gracza[client][1] = 3; case 19: informacje_itemu_gracza[client][1] = 1; case 22: informacje_itemu_gracza[client][1] = 0; case 25: informacje_itemu_gracza[client][1] = 1; case 32: { if(klasa_gracza[client] != Szpieg) SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(6, 10)]: modele_serwera[GetRandomInt(1, 5)]); GivePlayerItem(client, nazwy_broni[36]); } case 33: GivePlayerItem(client, nazwy_broni[36]); case 38: informacje_itemu_gracza[client][1] = 1; case 45: SetEntData(client, FindSendPropOffs("CCSPlayer", "m_iAccount"), GetEntData(client, FindSendPropOffs("CCSPlayer", "m_iAccount"))+3000); } if(punkty_gracza[client] > 0) PrzydzielPunkty(client); for(new slot = 0; slot < 5; slot ++) GivePlayerItem(client, nazwy_broni[bronie_klas[klasa_gracza[client]][slot]]); } maksymalne_zdrowie_gracza[client] = umiejetnosci_klas[klasa_gracza[client]][1]+zdrowie_gracza[client]+bonusowe_zdrowie_gracza[client]; SetEntData(client, FindDataMapOffs(client, "m_iHealth"), maksymalne_zdrowie_gracza[client]); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0*umiejetnosci_klas[klasa_gracza[client]][3]*0.01+(kondycja_gracza[client]+bonusowa_kondycja_gracza[client])*0.001); } } } if(klasa_gracza[client] != Kameleon) { SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(6, 10)]: modele_serwera[GetRandomInt(1, 5)]); GivePlayerItem(client, nazwy_broni[36]); } case 33: GivePlayerItem(client, nazwy_broni[36]); case 38: informacje_itemu_gracza[client][1] = 1; case 45: SetEntData(client, FindSendPropOffs("CCSPlayer", "m_iAccount"), GetEntData(client, FindSendPropOffs("CCSPlayer", "m_iAccount"))+3000); { if(punkty_gracza[client] > 0) PrzydzielPunkty(client); for(new slot = 0; slot < 5; slot ++) GivePlayerItem(client, nazwy_broni[bronie_klas[klasa_gracza[client]][slot]]); } maksymalne_zdrowie_gracza[client] = umiejetnosci_klas[klasa_gracza[client]][1]+zdrowie_gracza[client]+bonusowe_zdrowie_gracza[client]; SetEntData(client, FindDataMapOffs(client, "m_iHealth"), maksymalne_zdrowie_gracza[client]); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0*umiejetnosci_klas[klasa_gracza[client]][3]*0.01+(kondycja_gracza[client]+bonusowa_kondycja_gracza[client])*0.001); } public Action:DajItem(client, item) { if(informacje_itemu_gracza[client][0]) UsunItem(client); moc_itemu[client] = 100; informacje_itemu_gracza[client][0] = item; switch(item) { case 1: { if(IsPlayerAlive(client)) SetEntData(client, FindDataMapOffs(client, "m_iHealth"), GetClientHealth(client)+100);
Linux'
19.08.2015
naprawdę nic a nic nie dziwi cie, ze masz wklepany ten sam kod jeden pod drugim? Podeslij kod calego publicu.
bas233 19.08.2015
naprawdę nic a nic nie dziwi cie, ze masz wklepany ten sam kod jeden pod drugim? Podeslij kod calego publicu.
public Action:Odrodzenie(client) { if(!IsValidClient(client) || !IsPlayerAlive(client)) return; if(!klasa_gracza[client]) WybierzKlase(client); else { if(nowa_klasa_gracza[client]) { klasa_gracza[client] = nowa_klasa_gracza[client]; nowa_klasa_gracza[client] = 0; SetEntityGravity(client, 1.0); ilosc_rakiet_gracza[client] = 0; ilosc_dynamitow_gracza[client] = 0; ilosc_apteczek_gracza[client] = 0; CS_UpdateClientModel(client); WczytajDane(client, klasa_gracza[client]); } switch(klasa_gracza[client]) { case WsparcieOgniowe: ilosc_rakiet_gracza[client] = 2; case Kamikadze: ilosc_rakiet_gracza[client] = 3; case Strzelec: ilosc_rakiet_gracza[client] = 1; case Kozak: ilosc_rakiet_gracza[client] = 2; case Longer: ilosc_rakiet_gracza[client] = 4; case Saper: ilosc_dynamitow_gracza[client] = 2; case BomberMan: ilosc_dynamitow_gracza[client] = 2; case Medyk: ilosc_apteczek_gracza[client] = 2; case Kangur: czas_skokow_gracza[client] = 0; case Szpieg: SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(6, 10)]: modele_serwera[GetRandomInt(1, 5)]); } switch(informacje_itemu_gracza[client][0]) { case 4: informacje_itemu_gracza[client][1] = 1; case 14: informacje_itemu_gracza[client][1] = 3; case 19: informacje_itemu_gracza[client][1] = 1; case 22: informacje_itemu_gracza[client][1] = 0; case 25: informacje_itemu_gracza[client][1] = 1; case 32: { if(klasa_gracza[client] != Szpieg) SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(6, 10)]: modele_serwera[GetRandomInt(1, 5)]); GivePlayerItem(client, nazwy_broni[36]); } case 33: GivePlayerItem(client, nazwy_broni[36]); case 38: informacje_itemu_gracza[client][1] = 1; case 45: SetEntData(client, FindSendPropOffs("CCSPlayer", "m_iAccount"), GetEntData(client, FindSendPropOffs("CCSPlayer", "m_iAccount"))+3000); } if(punkty_gracza[client] > 0) PrzydzielPunkty(client); for(new slot = 0; slot < 5; slot ++) GivePlayerItem(client, nazwy_broni[bronie_klas[klasa_gracza[client]][slot]]); } maksymalne_zdrowie_gracza[client] = umiejetnosci_klas[klasa_gracza[client]][1]+zdrowie_gracza[client]+bonusowe_zdrowie_gracza[client]; SetEntData(client, FindDataMapOffs(client, "m_iHealth"), maksymalne_zdrowie_gracza[client]); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0*umiejetnosci_klas[klasa_gracza[client]][3]*0.01+(kondycja_gracza[client]+bonusowa_kondycja_gracza[client])*0.001); }
Potem jest Public action daj item .
Linux'
19.08.2015
public Action:Odrodzenie(client) { if(!IsValidClient(client) || !IsPlayerAlive(client)) return; if(!klasa_gracza[client]) WybierzKlase(client); else { if(nowa_klasa_gracza[client]) { klasa_gracza[client] = nowa_klasa_gracza[client]; nowa_klasa_gracza[client] = 0; SetEntityGravity(client, 1.0); ilosc_rakiet_gracza[client] = 0; ilosc_dynamitow_gracza[client] = 0; ilosc_apteczek_gracza[client] = 0; CS_UpdateClientModel(client); WczytajDane(client, klasa_gracza[client]); } switch(klasa_gracza[client]) { case WsparcieOgniowe: ilosc_rakiet_gracza[client] = 2; case Kamikadze: ilosc_rakiet_gracza[client] = 3; case Strzelec: ilosc_rakiet_gracza[client] = 1; case Kozak: ilosc_rakiet_gracza[client] = 2; case Longer: ilosc_rakiet_gracza[client] = 4; case Saper: ilosc_dynamitow_gracza[client] = 2; case BomberMan: ilosc_dynamitow_gracza[client] = 2; case Medyk: ilosc_apteczek_gracza[client] = 2; case Kangur: czas_skokow_gracza[client] = 0; case Szpieg: SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(6, 10)]: modele_serwera[GetRandomInt(1, 5)]); case Kameleon: SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(6, 10)]: modele_serwera[GetRandomInt(1, 5)]); } switch(informacje_itemu_gracza[client][0]) { case 4: informacje_itemu_gracza[client][1] = 1; case 14: informacje_itemu_gracza[client][1] = 3; case 19: informacje_itemu_gracza[client][1] = 1; case 22: informacje_itemu_gracza[client][1] = 0; case 25: informacje_itemu_gracza[client][1] = 1; case 32: { if(klasa_gracza[client] != Szpieg && klasa_gracza[client] != Kameleon) SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(6, 10)]: modele_serwera[GetRandomInt(1, 5)]); GivePlayerItem(client, nazwy_broni[36]); } case 33: GivePlayerItem(client, nazwy_broni[36]); case 38: informacje_itemu_gracza[client][1] = 1; case 45: SetEntData(client, FindSendPropOffs("CCSPlayer", "m_iAccount"), GetEntData(client, FindSendPropOffs("CCSPlayer", "m_iAccount"))+3000); } if(punkty_gracza[client] > 0) PrzydzielPunkty(client); for(new slot = 0; slot < 5; slot ++) GivePlayerItem(client, nazwy_broni[bronie_klas[klasa_gracza[client]][slot]]); } maksymalne_zdrowie_gracza[client] = umiejetnosci_klas[klasa_gracza[client]][1]+zdrowie_gracza[client]+bonusowe_zdrowie_gracza[client]; SetEntData(client, FindDataMapOffs(client, "m_iHealth"), maksymalne_zdrowie_gracza[client]); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0*umiejetnosci_klas[klasa_gracza[client]][3]*0.01+(kondycja_gracza[client]+bonusowa_kondycja_gracza[client])*0.001); }
Musisz jeszcze przerobic przedmiot "Podrecznik Szpiega" tak by nie dawal stroju przy zdobyciu/wyrzuceniu jezeli gracz gra Kameleonem bo bedzie sie bugowac.