Sariiz 0 Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 Zdravim. Vytvaram svoj Adminscript s Anticheatom a práve som vytvoril funkciu, ktoru mám odskusanu a funguje. Funguje na principe ze hraca nevyhodi ale upozorni administratora na cheatera. A ak sa ziadny admin nenachadza na nservery tak mu da kick! Ak má hrac neobmedzene ammo tzn. zamrznute. Najprv definujeme premenne new oldammo, newammo; #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) //ak je hrac na nohach nie v aute { if(PRESSED(KEY_FIRE)) { if (HavePlayerWeapon(playerid)) //stock na zistenie ci ma zbran { oldammo = GetPlayerAmmo(playerid); // ulozenie amma SetTimerEx("CheckAmmo", 1000, false, "i", playerid); } return false; } } return true; } public CheckAmmo(playerid) { newammo = GetPlayerAmmo(playerid); if (oldammo == newammo){ SendWarningMessage(playerid, "Unlimited Ammo"); } return true; } stock SendWarningMessage(playerid, thread[]) { if (AdminsOnline() > 0) { for (new i;i<=MAX_PLAYERS_EX;i++) { if (IsPlayerConnected(i) && IsPlayerAdmin(i)) { new str[250]; format(str, sizeof(str),"[ Anticheat] Potencionalny cheater [Nick]] [%s]", GetName(playerid), playerid, thread); SendClientMessage(i, 0xFF0000AA, str); } } } else { new str[200]; format(str, sizeof(str),"[ Anticheat] %s bol automaticky vyhodeny pre %s", GetName(playerid), thread); SendClientMessageToAll(0xFF0000AA, str); Kick(playerid); } return true; } stock HavePlayerWeapon(playerid) // tnx to ATomas { switch(GetPlayerWeapon(playerid)) { case 16..18,22..39,41,42: return true; default: return false; } } AdminsOnline() { new p; for(new i=0;i<=MAX_PLAYERS_EX;i++) if(IsPlayerConnected(i)) if(IsPlayerAdmin(i)) p++; return p; } V prípade, že by ste našly ako to obísť tak reply. Ďakujem vopred Link to comment Share on other sites More sharing options...
OnlyHacky 0 Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 nice...jednoduche a strucne Link to comment Share on other sites More sharing options...
Sariiz 0 Odesláno: 26. Duben, 2011 Author Share Odesláno: 26. Duben, 2011 len som tam prave nasiel chybu ze aj ked je admin na servery tak to hraca vyhodi idem to opravit a updatetnem to Link to comment Share on other sites More sharing options...
DooM 93 Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 niCe Link to comment Share on other sites More sharing options...
Sariiz 0 Odesláno: 26. Duben, 2011 Author Share Odesláno: 26. Duben, 2011 diki. Uz to budem mat hotove tu novu verziu lebo toto co som SEM DAL ide inac.. toto nove je este kratsie /// EIDT:: HOTOVO OPRAVENE!! Link to comment Share on other sites More sharing options...
Guest Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 Podobne som to mal vymyslené aj ja lenže to bolo trošku inač pekne ale tie stringy... new str[250]; SCM(TA) môže mať iba 128 znakov čiže si vytvoril 122 premien na nič... Link to comment Share on other sites More sharing options...
Lax. 28 Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 pekné.. hodí sa mi možno Link to comment Share on other sites More sharing options...
ATomas 291 Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 nedami to mam takovou "estetickou" pripominku stock HavePlayerWeapon(playerid) { new Weapon = GetPlayerWeapon(playerid); if (Weapon == 16 || Weapon == 17 || Weapon == 18 || Weapon == 22) return true; else if (Weapon == 23 || Weapon == 24 || Weapon == 25 || Weapon == 26) return true; else if (Weapon == 27 || Weapon == 28 || Weapon == 29 || Weapon == 30) return true; else if (Weapon == 31 || Weapon == 32 || Weapon == 33 || Weapon == 34) return true; else if (Weapon == 35 || Weapon == 36 || Weapon == 37 || Weapon == 38) return true; else if (Weapon == 39 || Weapon == 41 || Weapon == 42 ) return true; else return false; } stock HavePlayerWeapon(playerid) { switch(GetPlayerWeapon(playerid)) { case 16..18,22..39,41,42: return true; default: return false; } } co je hezci ? Link to comment Share on other sites More sharing options...
Sariiz 0 Odesláno: 26. Duben, 2011 Author Share Odesláno: 26. Duben, 2011 nedami to mam takovou "estetickou" pripominku stock HavePlayerWeapon(playerid) { new Weapon = GetPlayerWeapon(playerid); if (Weapon == 16 || Weapon == 17 || Weapon == 18 || Weapon == 22) return true; else if (Weapon == 23 || Weapon == 24 || Weapon == 25 || Weapon == 26) return true; else if (Weapon == 27 || Weapon == 28 || Weapon == 29 || Weapon == 30) return true; else if (Weapon == 31 || Weapon == 32 || Weapon == 33 || Weapon == 34) return true; else if (Weapon == 35 || Weapon == 36 || Weapon == 37 || Weapon == 38) return true; else if (Weapon == 39 || Weapon == 41 || Weapon == 42 ) return true; else return false; } stock HavePlayerWeapon(playerid) { switch(GetPlayerWeapon(playerid)) { case 16..18,22..39,41,42: return true; default: return false; } } co je hezci ? ja viem ATomas to som chcel lenze sa mi nechcelo premislat nad tym ale presne som toto chcel spravit. Dik ulahcil si mi pracu Link to comment Share on other sites More sharing options...
-GSG-Nuke 1 Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 Good! a nwm jak ti mohl ulechčit práci? když už to máš napsaný Link to comment Share on other sites More sharing options...
Sariiz 0 Odesláno: 26. Duben, 2011 Author Share Odesláno: 26. Duben, 2011 Ale on mi napisal stock ktory iba skopcim a nemusim pisat a rozmyslat nad tym Link to comment Share on other sites More sharing options...
MinecraftPlayer 0 Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 pěkný ja si udělal podle atomosovo anti money cheatu i anti healht a i anti weapon takže jakoby cheateři nemají šanci ... Pěkný 10/0 Link to comment Share on other sites More sharing options...
Sariiz 0 Odesláno: 26. Duben, 2011 Author Share Odesláno: 26. Duben, 2011 pěkný ja si udělal podle atomosovo anti money cheatu i anti healht a i anti weapon takže jakoby cheateři nemají šanci ... Pěkný 10/0 dik Link to comment Share on other sites More sharing options...
Guest Ceasar Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 dobrééé 1o/1o Link to comment Share on other sites More sharing options...
Guest Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 podla atomasovho ? to nevieš robiť s premenou ? aha new bool:weapon[45][MAX_PLAYERS_EX]; (dalo by sa to aj na sloty, ale ja radšej na všetky zbrane jednotlivo Link to comment Share on other sites More sharing options...
Sariiz 0 Odesláno: 26. Duben, 2011 Author Share Odesláno: 26. Duben, 2011 podla atomasovho ? to nevieš robiť s premenou ? aha new bool:weapon[45][MAX_PLAYERS_EX]; (dalo by sa to aj na sloty, ale ja radšej na všetky zbrane jednotlivo Viem omfg uz to nerieste je to? funguje to? tak co Link to comment Share on other sites More sharing options...
Guest Odesláno: 26. Duben, 2011 Share Odesláno: 26. Duben, 2011 hovorím loloe Link to comment Share on other sites More sharing options...
Sariiz 0 Odesláno: 26. Duben, 2011 Author Share Odesláno: 26. Duben, 2011 hovorím loloe jááj sa daj citaciu lebo som magor uz Link to comment Share on other sites More sharing options...
damo115 0 Odesláno: 6. Květen, 2011 Share Odesláno: 6. Květen, 2011 kde mam dat AdminsOnline Link to comment Share on other sites More sharing options...
GarNERD 0 Odesláno: 6. Květen, 2011 Share Odesláno: 6. Květen, 2011 hocikam do GM Link to comment Share on other sites More sharing options...
damo115 0 Odesláno: 6. Květen, 2011 Share Odesláno: 6. Květen, 2011 mam chybu C:\Users\Damián\Downloads\Crazy San Fierro\truck.pwn(1010) : warning 235: public function lacks forward declaration (symbol "CheckAmmo") Link to comment Share on other sites More sharing options...
GarNERD 0 Odesláno: 6. Květen, 2011 Share Odesláno: 6. Květen, 2011 forward CheckAmmo(); Link to comment Share on other sites More sharing options...
damo115 0 Odesláno: 6. Květen, 2011 Share Odesláno: 6. Květen, 2011 error 025: function heading differs from prototype Link to comment Share on other sites More sharing options...
GarNERD 0 Odesláno: 7. Květen, 2011 Share Odesláno: 7. Květen, 2011 error 025: function heading differs from prototype forward CheckAmmo(playerid); Link to comment Share on other sites More sharing options...
damo115 0 Odesláno: 7. Květen, 2011 Share Odesláno: 7. Květen, 2011 uz to ide len som to prerobil ze nebude posielat adminom Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now