15.08.2013, 09:29
FIXED
new name[MAX_PLAYER_NAME], targetid=-1; // String who will store players name, targetid who will store the targetid.
for(new i=0,j=GetMaxPlayers();i<j;i++) // Loop players
if(IsPlayerConnected(i)) // If playerid connected
{
GetPlayerName(i, name, sizeof(name)); // Get ID's name
if(!strcmp(name,"Target_Name") // Checks if the Id's name is what we wanted.
{
targetid = i; // Defines targerid
break; //No need to contuine the loop.
}
}
if(targetid==-1)return Player Not Found ! // If player not found, returns MSG for exmple.