Jump to content
MakeWebGames

Recommended Posts

Posted

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

screnie.png

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

Posted

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.

Posted

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']}");

Posted

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.

Posted

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.

Posted

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.

Posted

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

Posted

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']}");

Posted

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

Posted

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']."");

Posted

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

Posted

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.

Posted

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

Posted

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 :)

Posted

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:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...