19.12.2019, 16:56
hello,
i'm experiencing an error on my command called stats, tried a few ways, but still couldn't overcome that error. so here's my command:
the error's this:
that might be easy for some of you around here, but for me it isn't, since i'm a newbie in scripting, and yes i'm still watching tutorials
i'm thankful for any responses given
i'm experiencing an error on my command called stats, tried a few ways, but still couldn't overcome that error. so here's my command:
Code:
CMD:stats(playerid, params[]) { if(PlayerInfo[playerid][LoggedIn] == true) { new string[256], id, tname[MAX_PLAYER_NAME]; new admin, kills, deaths, registered[6], score, money, admrank[32]; if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /stats <playerid>"); if(id == INVALID_PLAYER_ID) { GetPlayerName(id, tname, sizeof(tname)); admin = PlayerInfo[playerid][AdminLevel]; kills = PlayerInfo[playerid][Kills]; deaths = PlayerInfo[playerid][Deaths]; score = PlayerInfo[playerid][Score]; money = GetPlayerMoney(playerid); if(PlayerInfo[id][LoggedIn] == false) { switch(PlayerInfo[id][LoggedIn]) { case 0: registered = "No"; } } else { switch(PlayerInfo[id][LoggedIn]) { case 1: registered = "Yes"; } } if(IsPlayerAdmin(id)) { format(string,sizeof(string), "{00FF00}Name:{FFFFFF} %s\n{00FF00}Registered:{FFFFFF} %s\n{00FF00}Admin Level:{FF0000} RCON Admin\n{00FF00}Kills:{FFFFFF} %d\n{00FF00}Deaths:{FFFFFF} %d\n{00FF00}Score:{FFFFFF} %d\n{00FF00}Money:{FFFFFF} %d",tname, registered, kills, deaths, score, money); ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FFFFFF}Player's Statistics:", string, "Okay", ""); } else if(PlayerInfo[id][AdminLevel] > 0) { switch(PlayerInfo[id][AdminLevel]) { case 1: admrank = "{FFFF00}(Moderator)"; case 2: admrank = "{008000}(Administrator)"; case 3: admrank = "{3366FF}(Manager)"; } } format(string,sizeof(string), "{00FF00}Name:{FFFFFF} %s\n{00FF00}Registered:{FFFFFF} %s\n{00FF00}Admin Level:{FFFFFF} %d %s\n{00FF00}Kills:{FFFFFF} %d\n{00FF00}Deaths:{FFFFFF} %d\n{00FF00}Score:{FFFFFF} %d\n{00FF00}Money:{FFFFFF} %d",tname, registered, admin, admrank, kills, deaths, score, money); ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FFFFFF}Player's Statistics:", string, "Okay", ""); } else { format(string, sizeof(string), "{00FF00}Name:{FFFFFF} %s\n{00FF00}Registered:{FFFFFF} %s\n{00FF00}Kills:{FFFFFF} %d\n{00FF00}Deaths:{FFFFFF} %d\n{00FF00}Score:{FFFFFF} %d\n{00FF00}Money:{FFFFFF} %d", tname, registered, kills, deaths, score, money); ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FFFFFF}Player's Statistics:", string, "Okay", ""); return 1; } else return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected"); } else return SendClientMessage(playerid, COLOR_RED, "ERROR: Account must be registered in order to use commands."); }
Code:
C:\Users\Heheboii\Desktop\samp037_svr_R2-1-1_win32 (1)\gamemodes\fps.pwn(1013) : error 029: invalid expression, assumed zero C:\Users\Heheboii\Desktop\samp037_svr_R2-1-1_win32 (1)\gamemodes\fps.pwn(1013) : warning 215: expression has no effect C:\Users\Heheboii\Desktop\samp037_svr_R2-1-1_win32 (1)\gamemodes\fps.pwn(1013) : error 001: expected token: ";", but found "return" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
i'm thankful for any responses given