i'm tring to add the functions Reduceplayerscore and Zerofrag on NexgenABM for not lost it on moderate pannel when i use this plugin.
But i got this error : Error: C:\UT coding\UnrealTournament\NexgenABM201SDL\Classes\NexgenABMModeratePanel.uc(215) : Error, Call to 'reducePlayerScore': Bad ';' or missing ')'
Code: Select all
/***************************************************************************************************
*
* $DESCRIPTION Notifies the dialog of an event (caused by user interaction with the interface).
* $PARAM control The control object where the event was triggered.
* $PARAM eventType Identifier for the type of event that has occurred.
* $REQUIRE control != none
* $OVERRIDE
*
**************************************************************************************************/
function notify(UWindowDialogControl control, byte eventType) {
super.notify(control, eventType);
if (control == warnButton && !warnButton.bDisabled && eventType == DE_Click) {
if(warnInp.getValue() == "") client.showMsg("<C00>You have to enter a reason.");
else {
xClient.warnPlayer(NexgenPlayerList(playerList.selectedItem).pNum, class'NexgenUtil'.static.trim(warnInp.getValue()), hideNameInp.bChecked);
}
}
if (control == reduceScoreButton && !reduceScoreButton.bDisabled && eventType == DE_Click) {
if(BanReasonInp.getValue() == "") client.showMsg("client.lng.needreasonReminderMsg.");
else {
xClient.reducePlayerScore(NexgenPlayerList(playerList.selectedItem).pNum, client.sConf.reduceScorePenaltyAmount, class'NexgenUtil'.static.trim(banReasonInp.getValue());
}
}
if (control == zeroFragButton && !zeroFragButton.bDisabled && eventType == DE_Click) {
if(BanReasonInp.getValue() == "") client.showMsg("client.lng.needreasonReminderMsg.");
else {
xClient.(NexgenPlayerList(playerList.selectedItem).pNum, client.sConf.zerofragPenaltyAmount, class'NexgenUtil'.static.trim(banReasonInp.getValue());
}
}
if (control == myKickButton && !myKickButton.bDisabled && eventType == DE_Click) {
xClient.kickPlayer(NexgenPlayerList(playerList.selectedItem).pNum, class'NexgenUtil'.static.trim(banReasonInp.getValue()), hideNameInp.bChecked);
}
}
the fonction reducePlayerScore :
Code: Select all
/***************************************************************************************************
*
* $DESCRIPTION Reduces the score of the player by amount set in ini.
* $PARAM playerNum The player code of the player the player that score is to be reduced.
* $PARAM reason Description of why the player is having the score reduced.
*
**************************************************************************************************/
function reducePlayerScore(int playerNum, float reduceBy, string reason) {
local NexgenClient target;
// Preliminary checks.
if (!client.hasRight(client.R_Moderate)) {
return;
}
// Get target client.
target = control.getClientByNum(playerNum);
if (target == none) return;
// Check if player can kick/ban players that have an account on the server.
if (target.bHasAccount && !client.hasRight(client.R_BanAccounts)) {
client.showMsg(control.lng.noBanAccountRightMsg);
return;
}
// reduce the players score.
target.player.PlayerReplicationInfo.Score -= target.player.PlayerReplicationInfo.Score*reduceBy;
// Show dialog.
target.showPopup("NexgenReduceScoreDialog", reason);
// Announce event.
logAdminAction(control.lng.adminReducePlayerScoreMsg, target.playerName, reason);
}
/***************************************************************************************************
*
* $DESCRIPTION Reduces the score of the player by amount set in ini.
* $PARAM playerNum The player code of the player the player that score is to be reduced.
* $PARAM reason Description of why the player is having the score reduced.
*
**************************************************************************************************/
function ZeroFrag(int playerNum, float reduceBy, string reason) {
local NexgenClient target;
// Preliminary checks.
if (!client.hasRight(client.R_Moderate)) {
return;
}
// Get target client.
target = control.getClientByNum(playerNum);
if (target == none) return;
// Check if player can kick/ban players that have an account on the server.
if (target.bHasAccount && !client.hasRight(client.R_BanAccounts)) {
client.showMsg(control.lng.noBanAccountRightMsg);
return;
}
// reduce the players score.
target.player.PlayerReplicationInfo.Score -= target.player.PlayerReplicationInfo.Score*reduceBy;
// Show dialog.
target.showPopup("NexgenZeroFragDialog", reason);
// Announce event.
logAdminAction(control.lng.adminZeroFragMsg, target.playerName,reason);
}