Jump to content
MakeWebGames

[mccode] delete gang after respect hit 0


iseeyou94056

Recommended Posts

i dont know how most people do it but this is how i do it

in your brave or energy cron add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

and it should run that every 5 min or so if after it run there is a gang with 0 respect it will delete it and problems post here

Link to comment
Share on other sites

Re: delete gang after respect hit 0

 

i dont know how most people do it but this is how i do it

in your brave or energy cron add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

and it should run that every 5 min or so if after it run there is a gang with 0 respect it will delete it and problems post here

There is no `gangID` column in users. Also, this wont delete gang wars.

I use this:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Tested and works fine, Mines in daily cron though, This way it wont have to check the DB as much. This one will also clear gang wars.

Link to comment
Share on other sites

  • 2 months later...

Re: delete gang after respect hit 0

Iseeyou has been coding for year and think hes doing a good job. So what if he missed the wrong qurey. I was the one who gave him the cron to delete the gangs after zero, but it was cron. He made it possible for it to work in the files. LostOne thanks was looking for better way of doing gang delete after zero instead of the cron way. Both work so HUSH I got flipping headache from all the bitching

Link to comment
Share on other sites

  • 2 weeks later...

Re: delete gang after respect hit 0

Better idea run it in attack.php and just do sql to delete the ones that have negative or 0 respect. or do something like detecting if they are a member of a gang and if they are then make it run the coding otherwise make it not include it.

Link to comment
Share on other sites

  • 3 weeks later...

Re: delete gang after respect hit 0

I'll give the basic set up though

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

If clauses are very useful. Another way to write this coding wise is

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

I think it requires the 'gang' for it.... I'm not 100% sure. But thats the basic format. Both [red]SHOULD[/red] work

Link to comment
Share on other sites

Re: delete gang after respect hit 0

 

I'll give the basic set up though

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

If clauses are very useful. Another way to write this coding wise is

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

I think it requires the 'gang' for it.... I'm not 100% sure. But thats the basic format. Both [red]SHOULD[/red] work

Your second IF Statement won't work. It should look like this...

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

  • 8 months later...
  • 8 months later...

Re: delete gang after respect hit 0

 

i dont know how most people do it but this is how i do it

in your brave or energy cron add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

and it should run that every 5 min or so if after it run there is a gang with 0 respect it will delete it and problems post here

There is no `gangID` column in users. Also, this wont delete gang wars.

I use this:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Tested and works fine, Mines in daily cron though, This way it wont have to check the DB as much. This one will also clear gang wars.

When you say clear gang wars do you mean the clear gangs that wared the "0 respect" gang

I hope you understand that

Link to comment
Share on other sites

  • 5 months later...

"$gangs=$db->query("SELECT * FROM gangs WHERE gangRESPECT<=0");

while($gang=$db->fetch_row($gangs))

{

$delete=$gang['gangID'];

$db->query("DELETE FROM gangwars WHERE warDECLARER=$delete OR warDECLARED=$delete");

$db->query("DELETE FROM gangs WHERE gangRESPECT<=0");

$db->query("UPDATE users SET gang='0' WHERE gang=$delete");

}"

Link to comment
Share on other sites

Yu

i dont know how most people do it but this is how i do it

in your brave or energy cron add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

and it should run that every 5 min or so if after it run there is a gang with 0 respect it will delete it and problems post here

There is no `gangID` column in users. Also, this wont delete gang wars.

I use this:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Tested and works fine, Mines in daily cron though, This way it wont have to check the DB as much. This one will also clear gang wars.

p this should work ;) BUT this one...made by iseeyou94056 wont work because its calling for a resource XD

i dont know how most people do it but this is how i do it

in your brave or energy cron add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

and it should run that every 5 min or so if after it run there is a gang with 0 respect it will delete it and problems post here

$gang=mysql_query("SELECT gangID FROM gangs WHERE gangRESPECT<0"); = ANY of the ids for the gangs with 0 respect

mysql_query("UPDATE users SET gang=0 WHERE gangID=$gang",$c); = ERROR :P

mysql_query("UPDATE users SET gang=0 WHERE gang=$gang",$c); = UPDATE nothing XD

 

 

$norespect=mysql_query("SELECT gangID FROM gangs WHERE gangRESPECT<0"); = ANY of the ids for the gangs with 0 respect

while($gang=mysql_fetch_row($norespect))

{

mysql_query("UPDATE users SET gang=0 WHERE gang=$gang",$c);

}

but still you need to delete the gang wars aswell :P infact anything to do with the gang XD

Link to comment
Share on other sites

Damn.

While loop and selecting and deleting all in one wow.

What say if there was 100 gangs or what ever with 0 respect. Means your going to do 100 select queries and 100 delete queries.

So why not just run two or three?

Simple..

Select the rows put them into an array then use MySQL IN ( ) and php implode( ). And your done. :D

Link to comment
Share on other sites

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...