05.06.2017, 13:01
Hello, I've tried making a command to make the admin with level 99999 above can do /addupdate with 3 different types [Implemented], [BugFix], [Pending GMX], whatever I got much errors and I don't understand what to do with them, PS:I tried to make it with MySQL but i found that it's kinda impossible because I still didn't learn anything about saving/loading from MySQL, Although I need someone to help me making a cmd that removes an update.
Enums :
Commands :
Errors :
Any Quick help?
Enums :
Код:
enum updateinfo { updatetype, updateimplemented, updatebug, updatepending, updatetext, }; new UpdateInfo[MAX_UPDATES][updateinfo];
Код:
CMD:addupdate(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 99999) { if(sscanf(params, "s[50]d", updatetext, updatetype)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /addupdate [text] [Update Type]"); { SendClientMessageEx(playerid, COLOR_GREY, "Available Types: 1 = Implemented, 2= Bug Fix, 3= Pending GMX"); } for(new i = 0; i < MAX_UPDATES; i++) if(updatetype == 1) { UpdateInfo[i][updatetype] = UpdateInfo[i][updateimplemented]; SendClientMessageToAll(COLOR_RED, "A new update was added!(/updates)"); return 1; } if(updatetype == 2) { UpdateInfo[i][updatetype] = UpdateInfo[i][updatebug]; SendClientMessageToAll(COLOR_RED, "A new update was added!(/updates)"); return 1; } if(updatetype == 3) { UpdateInfo[i][updatetype] = UpdateInfo[i][updatepending]; SendClientMessageToAll(COLOR_RED, "A new update was added!(/updates)"); return 1; } else if(PlayerInfo[playerid][pAdmin] < 99999) { SendClientMessageToAll(COLOR_GREY, "ERROR: You are not authorized to use this command!"); } } return 1; } CMD:updates(playerid, params[]) { new string[128]; new string2[50]; for(new i = 0; i < MAX_UPDATES; i++) SendClientMessageEx(playerid, COLOR_RED, "********* Nyakos City Roleplay Updates ************"); format(string, sizeof(string), "Version: %s", SERVER_GM_TEXT); SendClientMessageEx(playerid, COLOR_YELLOW, string); if(UpdateInfo[i][updatetype] = UpdateInfo[i][updateimplemented]) { format(string2, sizeof(string2), "[Implemented] %s", updatetext); SendClientMessageEx(playerid, COLOR_WHITE, string2); return 1; } if(UpdateInfo[i][updatetype] = UpdateInfo[i][updatebug]) { format(string2, sizeof(string2), "[Bug Fix] %s", updatetext); SendClientMessageEx(playerid, COLOR_WHITE, string2); return 1; } if(UpdateInfo[i][updatetype] = UpdateInfo[i][updatepending]) { format(string2, sizeof(string2), "[Pending GMX] %s", updatetext); SendClientMessage(playerid, COLOR_WHITE, string2); return 1; } SendClientMessageEx(playerid, COLOR_RED, "___________________________________________________"); }
Quote:
F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61825) : warning 216: nested comment F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61840) : warning 217: loose indentation F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61841) : warning 213: tag mismatch F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61841) : warning 205: redundant code: constant expression is zero F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61847) : warning 213: tag mismatch F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61847) : warning 205: redundant code: constant expression is zero F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61849) : error 017: undefined symbol "i" F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61853) : warning 213: tag mismatch F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61853) : warning 205: redundant code: constant expression is zero F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61855) : error 017: undefined symbol "i" F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61873) : error 017: undefined symbol "i" F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61879) : error 017: undefined symbol "i" F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61885) : error 017: undefined symbol "i" F:\SA-MP server\credit goes to mason\ogg\gamemodes\oggrp26.pwn(61892) : warning 209: function "cmd_updates" should return a value |