Sign in to follow this  
Jigglypuff

Colshape help pls

Recommended Posts

Posted (edited)

 

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

Share this post


Link to post
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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.