17.11.2013, 18:26
Recently I made this command:
Along with this one to go on admin duty:
But I get these errors:
1098 =
1097 =
Could someone explain to me how I can fix these errors?
Код:
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");