28.11.2014, 12:48
I have made a Register/login system - Works and I made some Stocks with some commands and when I do the two commands they do not show *Not linked*
CMD:makeadmin(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 6) { new iAdminValue, iTargetID; if(sscanf(params, "ii", iTargetID, iAdminValue)) { return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]"); } if(IsPlayerConnected(iTargetID)) { if(PlayerInfo[iTargetID][pHelper] >= 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot make moderators admins!"); new szMessage[47 + (MAX_PLAYER_NAME * 2)]; PlayerInfo[iTargetID][pAdmin] = iAdminValue; format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue); ABroadCast(COLOR_LIGHTRED,szMessage, 2); format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid)); SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage); format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage); } else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified."); } else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!"); return 1; } CMD:stats(playerid, params[]) { if (gPlayerLogged{playerid} != 0) { ShowStats(playerid,playerid); } return 1; }
ShowStats(playerid,targetid) { if(IsPlayerConnected(targetid)) { new sext[16]; if(PlayerInfo[targetid][pSex] == 1) { sext = "Male"; } else { sext = "Female"; } new age = PlayerInfo[targetid][pAge]; new ptime = PlayerInfo[targetid][pConnectTime]; new pot = PlayerInfo[targetid][pPot]; new crack = PlayerInfo[targetid][pCrack]; new meth = PlayerInfo[targetid][pMeth]; new money = PlayerInfo[targetid][pCash]; new coordsstring[268], str[3000]; format(coordsstring, sizeof(coordsstring),"Name: %s | Sex: %s| Age: %d | Cash: $%d | Playing hours: %d | Meth: %d | Crack: %d | Pot: %d\n", GetPlayerNameEx(targetid), sext, age, money, ptime, meth, crack, pot); strcat(str, coordsstring); if (PlayerInfo[playerid][pAdmin] >= 6) { if(PlayerInfo[targetid][pAdmin] >= 1) { format(coordsstring, sizeof(coordsstring), "Accepted reports: %d | Admin Messages Sent: %d\n", PlayerInfo[targetid][pReportsAccepted], PlayerInfo[targetid][pAMSSent]); strcat(str, coordsstring); } if(PlayerInfo[targetid][pHelper] >= 1) { format(coordsstring, sizeof(coordsstring), " Accepted help requests: %d\n", PlayerInfo[targetid][pAcceptedHelp]); strcat(str, coordsstring); } } ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}General Player Information", str, "Ok", "Close"); } }