04.01.2018, 13:36
I have This stock:
and i have this cmd:
There is no errors but when I type /myid from 2 accounts
both accounts give me id 0.. help please.
Код:
//==============================================================================
stock GetPlayerIdFromName(playername[])
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
if(strcmp(playername2, playername, true, strlen(playername)) == 0)
{
return i;
}
}
}
return INVALID_PLAYER_ID;
}
Код:
CMD:myid(playerid, params[])
{
new str3[80], GPID, name[MAX_PLAYER_NAME];
GPID=GetPlayerIdFromName(name);
format(str3, sizeof(str3), "Your Id Is:%i", GPID);
SCM(playerid, -1, str3);
}
both accounts give me id 0.. help please.


