GetPlayerID - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerID (
/showthread.php?tid=143942)
GetPlayerID -
ScottCFR - 24.04.2010
Is there a function to get the player slot? like someone with the ID: 0 or ID: 1 or ID: 2
I read through the wiki but didn't find anything
Re: GetPlayerID -
IamNotKoolllll - 24.04.2010
Quote:
|
Originally Posted by ScottCFR
Is there a function to get the player slot? like someone with the ID: 0 or ID: 1 or ID: 2
I read through the wiki but didn't find anything
|
its gone in 0.3 i had it in 0.2
Re: GetPlayerID -
IamNotKoolllll - 24.04.2010
Quote:
|
Originally Posted by ScottCFR
Is there a function to get the player slot? like someone with the ID: 0 or ID: 1 or ID: 2
I read through the wiki but didn't find anything
|
double post
try return user
Re: GetPlayerID -
dcmd_crash - 24.04.2010
Edit button?
pawn Код:
stock GetPlayerID(const Name[])
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new pName2[MAX_PLAYER_NAME];
GetPlayerName(i, pName2, sizeof(pName2));
if(strcmp(Name, pName2, true)==0)
{
return i;
}
}
}
return -1;
}
Re: GetPlayerID -
ScottCFR - 24.04.2010
Damn, Is there anything to check their playerid?
I'm making a rank system. It's set up on a MAX_PLAYERS kinda thing. So the call is Rank[playerid] == 1 or 0;. Theres a command to turn it off, So what it does is if it's 0 then it shuts it off for the playerid.
Re: GetPlayerID -
ScottCFR - 24.04.2010
Quote:
|
Originally Posted by _❼_
Edit button?
pawn Код:
stock GetPlayerID(const Name[]) { for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new pName2[MAX_PLAYER_NAME]; GetPlayerName(i, pName2, sizeof(pName2)); if(strcmp(Name, pName2, true)==0) { return i; } } } return -1; }
|
I don't need to get thier name. I need the playerid slot number.
Re: GetPlayerID -
IamNotKoolllll - 24.04.2010
Quote:
|
Originally Posted by ScottCFR
Damn, Is there anything to check their playerid?
I'm making a rank system. It's set up on a MAX_PLAYERS kinda thing. So the call is Rank[playerid] == 1 or 0;. Theres a command to turn it off, So what it does is if it's 0 then it shuts it off for the playerid.
|
how dose it rank show code
Re: GetPlayerID -
dcmd_crash - 24.04.2010
That's why it's called GetPlayerID



















Re: GetPlayerID -
IamNotKoolllll - 24.04.2010
Quote:
|
Originally Posted by ScottCFR
Quote:
|
Originally Posted by _❼_
Edit button?
pawn Код:
stock GetPlayerID(const Name[]) { for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new pName2[MAX_PLAYER_NAME]; GetPlayerName(i, pName2, sizeof(pName2)); if(strcmp(Name, pName2, true)==0) { return i; } } } return -1; }
|
I don't need to get thier name. I need the playerid slot number.
|
it compairs the name if the name is compaired and is true it returns the id
Re: GetPlayerID -
dcmd_crash - 24.04.2010
Quote:
|
Originally Posted by ScottCFR
Quote:
|
Originally Posted by _❼_
Edit button?
pawn Код:
stock GetPlayerID(const Name[]) { for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new pName2[MAX_PLAYER_NAME]; GetPlayerName(i, pName2, sizeof(pName2)); if(strcmp(Name, pName2, true)==0) { return i; } } } return -1; }
|
I don't need to get thier name. I need the playerid slot number.
|
I'm embarrassed for you right now, dawg.