10.06.2014, 11:45
Hi, I invented this thing to Sampo that when the server is the player whose name is more than 15 words then you type in chat @ ID .... ID that player you want is to show you the name ...
Code:
public OnPlayerText(playerid, text[]) { new string[128]; format(string, sizeof(string), "%s", text); for (new i; i < 128; i++) { if (string[i] == '@') { if ((string[i + 1] > 47) && (string[i + 1] < 58)) { new id = strval(string[i + 1]); if (id <= 500) { if (IsPlayerConnected(id)) { new menohraca[MAX_PLAYER_NAME]; GetPlayerName(id, menohraca, MAX_PLAYER_NAME); new j = (i + 1); while ((j < (i + 5)) && ((string[j] > 47) && (string[j] < 58))) j++; strdel(string, i, j); strins(string, menohraca, i, 128); } else { SendClientMessage(playerid, 0xFF0000FF, "Zlй ID"); return 0; } } else { SendClientMessage(playerid, 0xFF0000FF, "Zlй ID"); return 0; } } } } SendPlayerMessageToAll(playerid, string); return 0; }