Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ReturnUser(text[])
- {
- new pos = 0;
- while (text[pos] < 0x21)
- {
- if (text[pos] == 0) return INVALID_PLAYER_ID;
- pos++;
- }
- new userid = INVALID_PLAYER_ID;
- if (IsNumeric(text[pos]))
- {
- userid = strval(text[pos]);
- if (userid >=0 && userid < MAX_PLAYERS)
- {
- if(!IsPlayerConnected(userid))
- {
- userid = INVALID_PLAYER_ID;
- }
- else
- {
- return userid;
- }
- }
- }
- new giveid;
- new GetPlayer[256];
- for (giveid=0; giveid<=MAX_PLAYERS; giveid++)
- {
- if (IsPlayerConnected(giveid))
- {
- GetPlayerName(giveid,GetPlayer,16);
- new space = (strfind(GetPlayer, text,true));
- if (space != -1)
- {
- return giveid;
- }
- }
- }
- return userid;
- }
Advertisement
Add Comment
Please, Sign In to add comment