27.03.2019, 09:54
Quote:
Do you mean
pawn Code:
pawn Code:
|
pawn Code:
if ( playerData[playerid][playerLevel] < 6 )
return SendClientMessage(playerid, -1, "{F81414}[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command." );
{
pawn Code:
if ( playerData[playerid][playerLevel] < 6 )
{
return SendClientMessage(playerid, -1, "{F81414}[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command." );
}
pawn Code:
if ( playerData[playerid][playerLevel] < 6 ) return SendClientMessage(playerid, -1, "{F81414}[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command." );
Following, this is how I would simplify the command.
pawn Code:
COMMAND:playertokens(playerid, params[])
{
if(!playerData[playerid][playerLoggedIn]) return 1; //assume this could be removed since player would not have playerLevel if not logged in?
if(playerData[playerid][playerLevel] < 6) return SendClientMessage(playerid, -1, "{F81414}[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command." );
new otherID;
if(!sscanf(params, "u", otherID)) return SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}Usage: \"playertokens <playerid>\"");
if(!IsPlayerConnected(otherID)) return SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not online!");
if(!playerData[otherID][playerLoggedIn]) return SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not logged in!");
new message[128];
format(message, sizeof(message), "{B7B7B7}[INFO] {FFFFFF}%s(%i) has {FFDC2E}%i {FFFFFF}tokens.", playerData[otherID][playerNamee], otherID, playerData[otherID][rTokens]);
SendClientMessage(playerid, COLOR_WHITE, message);
return 1;
}