Dayo Posted March 27, 2009 Posted March 27, 2009 Assassinate user This script will alow any donator to attack any one anonimasly (soz my spellin is crap :-P), they will have a 20% chance of sucsess and will cos them $25,000. Screnies Make File assassinateuser.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Open Mainmenu.php Find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add After You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Thanks to Crazy-T for the help :D if you need any help/find a bug just post here. Enjoy :-D Quote
DELETE ME NOW! Posted March 27, 2009 Posted March 27, 2009 Re: [McCodes V2] Assassinate user (donator only) Thanks to Crazy-T for the help :D I only added, isset(); for you:P Quote
Dayo Posted March 27, 2009 Author Posted March 27, 2009 Re: [McCodes V2] Assassinate user (donator only) yea but im still learning php so if u didnt it would be two files Quote
DELETE ME NOW! Posted March 27, 2009 Posted March 27, 2009 Re: [McCodes V2] Assassinate user (donator only) lol :roll: Quote
Mafia-Club Posted March 27, 2009 Posted March 27, 2009 Re: [McCodes V2] Assassinate user (donator only) Nice Dayo Keep it up Quote
jonomatt Posted March 28, 2009 Posted March 28, 2009 Re: [McCodes V2] Assassinate user (donator only) It doesnt much but on make sure if you did what i did, you remove the '; and the end of the black list or you will get the error i did lol. Quote
mrmaxey Posted March 28, 2009 Posted March 28, 2009 Re: [McCodes V2] Assassinate user (donator only) event_add($user,"Some one attepted to assassinate you!",$c); $db->query("UPDATE users SET hp=1,hospital=25 ,hospreason='Failed Assassination' WHERE userid={$ir['userid']}"); cant i chainge this to like jail ? tryed it dont work. update users set jail=25,jail_reason=stupidkillers;P where userid={$ir['userid']}"); Quote
DELETE ME NOW! Posted March 28, 2009 Posted March 28, 2009 Re: [McCodes V2] Assassinate user (donator only) event_add($user,"Some one attepted to assassinate you!",$c); $db->query("UPDATE users SET hp=1,hospital=25 ,hospreason='Failed Assassination' WHERE userid={$ir['userid']}"); cant i chainge this to like jail ? tryed it dont work. update users set jail=25,jail_reason=stupidkillers;P where userid={$ir['userid']}"); Do this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Dayo Posted March 28, 2009 Author Posted March 28, 2009 Re: [McCodes V2] Assassinate user (donator only) also change this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. to this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
P3RKO Posted March 28, 2009 Posted March 28, 2009 Re: [McCodes V2] Assassinate user (donator only) I added it and i keep getting errors. could you tell me what is wrong with this? You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Djkanna Posted March 28, 2009 Posted March 28, 2009 Re: [McCodes V2] Assassinate user (donator only) This should work You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
P3RKO Posted March 28, 2009 Posted March 28, 2009 Re: [McCodes V2] Assassinate user (donator only) Thanks alot. its working now. +1 Quote
mrmaxey Posted March 29, 2009 Posted March 29, 2009 Re: [McCodes V2] Assassinate user (donator only) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and what if i want to add more updates to it like money crystals inventory etc. how do i do a multiple update cause i keep getting errors Quote
mrmaxey Posted March 29, 2009 Posted March 29, 2009 Re: [McCodes V2] Assassinate user (donator only) include("globals.php"); if ($ir['jail']) if ($in['money']) etc ? and $db->query("UPDATE `users` SET `jail`=`jail` + '25', `jail_reason`='stupidkillers' WHERE `userid` = {$ir['userid']}"); $db->query("UPDATE `users` SET `money`= `0', WHERE `userid` = $ir['userid']}"); Quote
DELETE ME NOW! Posted March 29, 2009 Posted March 29, 2009 Re: [McCodes V2] Assassinate user (donator only) $db->query("UPDATE `users` SET `money`= `0', WHERE `userid` = $ir['userid']}"); Here is what it should be. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. You put ` should of been ' and you missed { lol Quote
AlabamaHit Posted March 29, 2009 Posted March 29, 2009 Re: [McCodes V2] Assassinate user (donator only) $do = sprintf("UPDATE users SET money = 0 WHERE userid = %u",($ir['userid'])); $db->query($do); You don't have to use a ` also. you don't have to quote a Number. And um......what is the , for in it... if you don't want sprintf $db->query("UPDATE users SET money = 0 WHERE userid = ".$ir['userid'].""); Quote
DELETE ME NOW! Posted March 29, 2009 Posted March 29, 2009 Re: [McCodes V2] Assassinate user (donator only) Ahh yeah i forgot to remove the , lol and yeah Quote
mrmaxey Posted April 4, 2009 Posted April 4, 2009 Re: [McCodes V2] Assassinate user (donator only) and what if i wanna update on kill the whole account to be set back to start.. it needs allot of db query Quote
Assault Posted April 6, 2009 Posted April 6, 2009 Re: [McCodes V2] Assassinate user (donator only) For version 1 if anyone wants it (like me) BTW this mod works great! You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Dayo Posted April 6, 2009 Author Posted April 6, 2009 Re: [McCodes V2] Assassinate user (donator only) kk, thanks. Quote
chicka Posted April 14, 2009 Posted April 14, 2009 Re: [McCodes V2] Assassinate user (donator only) how can i change the success to 50% chance??? but it works great thanks Quote
Dayo Posted April 14, 2009 Author Posted April 14, 2009 Re: [McCodes V2] Assassinate user (donator only) find $rand = rand(1,5); ------------------------------------ replace with for 50% chance $rand = rand(1,2); Or if you want 10% $rand = mt_rand(1,10); or if you want 33% $rand = mt_rand(1,3); or if you want it based on level you could add (not tested) $level = $db->query('SELECT level FROM users WHERE userid = $user'); if ($level =< 20) { $maxrand = 5; //sets default chance to 20% if there level is below 20. } else { $maxrand1 = $level / 10; // This will get there level then divide it by 10 then round up/down so if thete level 100 there is a 1 in 10 chance $maxrand = round($maxrand1); } $rand = mt_rand(1,$maxrand); -------------------------------------------- that help ya :-D Quote
Magictallguy Posted April 14, 2009 Posted April 14, 2009 Re: [McCodes V2] Assassinate user (donator only) find $rand = rand(1,5); ------------------------------------ replace with $rand = rand(1,2); Or if you want 10% $rand = mt_rand(1,10); or if you want 33% $rand = mt_rand(1,3); or if you want it based on level you could add (not tested) $level = $db->query('SELECT level from users WHERE userid = $userid'); if ($level =< 20) { $maxrand = 5; //sets default chance to 20% if there level is below 20. } else { $maxrand1 = $level / 10; // This will get there level then divide it by 10 then round up/down so if thete level 100 there is a 1 in 10 chance $maxrand = round($maxrand1); } $rand = mt_rand(1,$maxrand); -------------------------------------------- that help ya :-D Simply using You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. would do the job :) Quote
Dayo Posted April 14, 2009 Author Posted April 14, 2009 Re: [McCodes V2] Assassinate user (donator only) no it wouldent cos you are selevcting that attacking users level so in theory a lvl 1 can gun a lvl 500 down with a 1 in 5 chance where as that will have a 1 in 50 chance :wink: Quote
Dayo Posted April 14, 2009 Author Posted April 14, 2009 Re: [McCodes V2] Assassinate user (donator only) woops i put $userid insted of $user :| Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.