SA-MP Forums Archive
/give and /take rights to someone - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /give and /take rights to someone (/showthread.php?tid=463111)



/give and /take rights to someone - Aleksabre - 10.09.2013

Can you explain me how to make in "pawno" that I can give and take rights from someone?
Like /giverights id and /takerights id, when i give someone rights, that it needs to say to him You have received "..." by me(means like player)
also when i take someone rights, he gets 0 hp so he's killed when i take someone rights, can you make me that for me because i really want this my I really don't know about that, thank you :$


Re: /give and /take rights to someone - Aleksabre - 10.09.2013

and yeah when someone wants to join that skin it says "you do not have a rights to join" so the leader "me or when i give someone a leader so he can give and take too rights, how do I do that and if you post a pastebin how to do that please tell me where to put, thank you :$


Re: /give and /take rights to someone - Aleksabre - 11.09.2013

Can anyone help pls?


Re: /give and /take rights to someone - RajatPawar - 11.09.2013

This can be done using MANY ways. They are:
1) Variable
2) Boolean
3) Enum

I find the 2nd or third the best, so here's some code for you.
pawn Код:
new bool: does_player_have_rights[ MAX_PLAYERS ]; //Create a boolean array for ALL players.

CMD:changerights(playerid, params[])
{
       if(sscanf(...)) // etc, etc
       {
              does_player_have_rights[ TARGET_ID ] = !does_player_have_rights[ TARGET_ID ]; // now target ID has rights opposite to those he had previously
       }
}

CMD:some_command_for_players_having_rights_only(playerid)
{
      if( does_player_have_rights[ playerid ] == false ) // or just !does_player...
      return 0; // no, he isn't allowed.
      else
      // allowed.
}
Hope you understood.


Re: /give and /take rights to someone - Aleksabre - 11.09.2013

thanks for posting but I don't understand, really, can you contact me on skype pls? Aleksa199771


Re: /give and /take rights to someone - Aleksabre - 11.09.2013

Can someone help me with this