hi
i would like to create a system of warning who store the name of player , ip, id reason and nomber of time the player has been warned. admin who issued the warning.
i need help for this fonction :
Error: L:\UnrealTournament\Nexgen112M\Classes\NexgenConfig.uc(1479) : Error, Bad or missing expression in 'If'
i would like to create a system of warning who store the name of player , ip, id reason and nomber of time the player has been warned. admin who issued the warning.
// ReasonsList.
Var config string ReasonsList[50]; // List of the reasons for warning.
// Warned list
Var config string WarnedPlayer[256]; // Name of Warned Player.
Var config int NBWarning[256]; // Number time of the player has been Warned.
var config string WarnerName[256]; // Name of the player who issued the warning.
Var config string WarnedIPs[256]; // IP adresse of the Warned Player.
Var config string WarnedIDs[256]; // Client ID of the Warned Player.
var config string WarningReason[256]; // Reason why the player was Warned.
i need help for this fonction :
Error: L:\UnrealTournament\Nexgen112M\Classes\NexgenConfig.uc(1479) : Error, Bad or missing expression in 'If'
function bool updateWarning(int index,int nbwarning, string playerIP, string playerID) {
local bool bnbwarningMatch;
local bool bIPMatch;
local bool bIDMatch;
local string remaining;
local string currIP;
local string currID;
local int ipCount;
local int idCount;
// Compare & count IP address.
remaining = warnedIPs[index];
while (!bIPMatch && remaining != "") {
class'NexgenUtil'.static.split(remaining, currIP, remaining);
currIP = class'NexgenUtil'.static.trim(currIP);
if (currIP ~= playerIP) {
bIPMatch = true;
} else {
ipCount++;
}
}
// Add IP address if not already in the list and the list isn't full.
if (!bIPMatch && ipCount < maxBanIPAddresses) {
if (warnedIPs[index] == "") {
warnedIPs[index] = playerIP;
} else {
warnedIPs[index] = warnedIPs[index] $ separator $ playerIP;
}
}
// Compare & count client ID's.
remaining = warnedIDs[index];
while (!bIDMatch && remaining != "") {
class'NexgenUtil'.static.split(remaining, currID, remaining);
currID = class'NexgenUtil'.static.trim(currID);
if (currID ~= playerID) {
bIDMatch = true;
} else {
idCount++;
}
}
// Add client ID if not already in the list and the list isn't full.
if (!bIDMatch && idCount < maxwarnedClientIDs) {
if (warnedIDs[index] == "") {
warnedIDs[index] = playerID;
} else {
warnedIDs[index] = warnedIDs[index] $ separator $ playerID;
}
}
//check if warning entry was updated
if (check if warned entry was updated (nbwarning[index]="$" +1) <<< ligne 1479
else
return false;
)
// Save changes.
if (!bnbwarningMatch||!bIPMatch || !bIDMatch) {
saveConfig();
return true;
} else {
return false;
}
}
Last edited: