CMD:setadminname(playerid, params[]) { new file[128], pname[MAX_PLAYER_NAME]; new id, reason[128]; new name[MAX_PLAYER_NAME+1]; GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), "USERFILES/%s.ini", pname); if(sscanf(params, "us", id, reason))SendClientMessage(playerid, COLOR_GREY, "USAGE: /setadminname [playerid] [name]"); else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_NEWBIE,"Player is not connected!"); else { new Name[MAX_PLAYER_NAME], KickMessage[128]; GetPlayerName(playerid, Name, sizeof(Name)); format(KickMessage, sizeof(KickMessage), "AdmCmd: %s has changed your admin name to %s", Name, reason); SendClientMessage(playerid, COLOR_LIGHTRED, KickMessage); SetPlayerName(playerid, reason); dini_IntSet(file, "AdminName", GetPlayerName(playerid, name, sizeof(name))); } return 1; }
CMD:adminduty(playerid, params[]) { new file[128], pname[MAX_PLAYER_NAME]; new adminname; GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), "USERFILES/%s.ini", pname); if(dini_Exists(file)) { adminname = dini_Int(file, "AdminName"); SetPlayerName(playerid, adminname); } return 1; }
C:\Users\TWLeg_000\Desktop\SAMP SERVER\gamemodes\BHRP1.pwn(1098) : error 035: argument type mismatch (argument 2) C:\Users\TWLeg_000\Desktop\SAMP SERVER\gamemodes\BHRP1.pwn(1097) : warning 204: symbol is assigned a value that is never used: "adminname"
SetPlayerName(playerid, adminname);
adminname = dini_Int(file, "AdminName");
C:\Users\TWLeg_000\Desktop\SAMP SERVER\gamemodes\BHRP1.pwn(1064) : error 033: array must be indexed (variable "adminname")
adminname = dini_Int(file, "AdminName");
to format(adminname, MAX_PLAYER_NAME, "%s", dini_Int(file, "AdminName")); |
AdminName=5
AdminName=Keogh