#include // - Fix /getid // Was bored, so made this for you :) It supports wildcards and is case // in-sensitive. /getid CyBErp would get a match on CyberPunk. #define COLOR_RED 0xDC143CFF #define COLOR_WHITE 0xFFFFFFAA #define COLOR_YELLOW 0xFFFF00AA main() { print("\n----------------------------------"); print(" This is a blank GameModeScript"); print("----------------------------------\n"); } new gPlayerNames[MAX_PLAYERS][24]; public OnPlayerConnect(playerid) { GetPlayerName(playerid, gPlayerNames[playerid], 24); return 1; } public OnPlayerDisconnect(playerid) { format(gPlayerNames[playerid], 24, "%s", ""); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { new string[256]; new cmd[256]; new idx; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/getid", true) == 0){ new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "Use: /getid playerName"); return 1; } new playerID = -1; playerID = NewPlayerID(tmp); if(playerID == -1){ format(string,sizeof(string),"No player with this name was found on the server.", tmp); SendClientMessage(playerid, COLOR_RED, string); return 1; } else if(playerID == -2){ SendClientMessage(playerid, COLOR_RED, "Multiple players with this name were found, please be more specific."); return 1; } else{ new ActualName[24]; GetPlayerName(playerID, ActualName, 24); format(string,sizeof(string), "Found player %s with ID: %d!", ActualName, playerID); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } } return 0; } public NewPlayerID(partofname[]) { new playername[256]; for (new i=0;i0) { return -2; // return MULTIPLE_PLAYERID } } } return correctsigns_userid; } //----------------------- Other stuff that has to be here, but isn't used. public OnGameModeInit() { SetGameModeText("Blank Script"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; } public OnPlayerRequestClass(playerid, classid) { printf("OnPlayerRequestClass(%d, %d)", playerid, classid); SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } // You probably have this already strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }