Jump to content

Colshape help pls


Jigglypuff

Recommended Posts

 

How to make it so that if 1 falls out, then one point will appear, if 0, then another

And where do you need to create points in the client or server?



mp.events.add("playerEnterColshape", playerEnterColshapeHandler);

function playerEnterColshapeHandler(player, shape) 
{
  if(shape == builduse) 
  {
    if(player.work_id) {
        gm.mysql.handle.query('UPDATE `accounts` SET work_id = ? WHERE username = ?', [0, player.name]);
        player.work_id = false;
        player.call("work_id", false);
    }
    else
    {
        gm.mysql.handle.query('UPDATE `accounts` SET work_id = ? WHERE username = ?', [1, player.name]);
        player.work_id = true;
        player.call("work_id", true);
    }
  }
         let random = Math.floor(Math.random() * 2);
        gm.mysql.handle.query('UPDATE `accounts` SET amount_builder = ? WHERE username = ?', [random, player.name]);
  if(shape == work1use)
    {
    if(player.point_builder == 0) {
            gm.mysql.handle.query('UPDATE `accounts` SET amount_builder = ? WHERE username = ?', [1, player.name]);
            player.point_builder = true;
            player.call("point_builder", true);
        }
    }
  if(shape == work2use)
    {
    if(player.point_builder == 1) {
            gm.mysql.handle.query('UPDATE `accounts` SET amount_builder = ? WHERE username = ?', [0, player.name]);
            player.point_builder = false;
            player.call("point_builder", false);
    }
}
}

Edited by Jigglypuff
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...