SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 08/12/2009, 01:58 AM   #11
lolumadd
Huge Clucker
 
Join Date: Sep 2009
Posts: 350
Reputation: 8
Default Re: Help, Player Id

I perfer an array.

pawn Code:
New BadIDs[] =
{
 0,1,2,3,4,5,6
};

public OnPlayerConnect(playerid)
{
if(playerid == BadIDs)
{
Kick(playerid)
}
else
{
SendClientMessage(playerid, COLOR, "You are not a bad id; congrats!");
}
__________________
lolumadd is offline  
Old 08/12/2009, 04:13 AM   #12
Balon
Big Clucker
 
Join Date: Oct 2007
Posts: 108
Reputation: 2
Default Re: Help, Player Id

@up: It won't work.
anyway..
pawn Code:
public OnPlayerConnect(playerid)
{
  switch(playerid)
  {
    case 0, 2, 4, 5, 6, 7, 8:
    {
      Kick(playerid);
    }

    default:
    {
      Ban(playerid);
    }
  }

  return 1;
}
Balon is offline  
Old 08/12/2009, 11:49 AM   #13
patchkinson
Gangsta
 
Join Date: Nov 2009
Posts: 548
Reputation: 1
Default Re: Help, Player Id

Quote:
Originally Posted by iLinx
to get even numbers you need to use a operator called modulus (%) what mod does is get the remainder of a divison operation.
for example 5/2 will return 1, becuase 5 divided by 2 has a remainder of 1. but 4/4 has a remainder of 0 (this is how you check for even or odd)

pawn Code:
public OnPlayerConnect(playerid)
{
  if(playerid%2 == 0) {
  //execute whatever you want to do if the playerid is even
  }
  else {
  //execute whatever you want to do if the playerid is odd
  }
  return 1;
}
thank you, code is really nice and WORKS PERFECT
patchkinson is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Add player/clan [tag] when player chooses class? fishnutslol Help Archive 7 08/07/2011 03:54 PM
Giving a Player money upon killing another player MrXavier Help Archive 2 04/11/2009 04:10 AM
How to disble player markers like dots? For certain player[FIXED] Kyle Help Archive 1 10/08/2009 03:58 PM
nedd help wit script that allows a player to teleport to another player figman Help Archive 6 11/04/2009 10:39 PM


All times are GMT. The time now is 02:39 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.