CMD:admins(playerid, params[]) { if(pInfo[playerid][pHour] >= 0) { new adminstring[128]; new text[128]; if(IsPlayerConnected(playerid)) { for (new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(pInfo[i][pAdminLevel] > 0) { format(adminstring, sizeof(adminstring),"%s%s %s\n / %s", adminstring, GetAdminName(i), PlayerName(i), ForumName(i)); format(text, sizeof(text),"Administratori Online"); } } } SendClientMessage(playerid,COLOR_WHITE, text); SendClientMessage(playerid,COLOR_GREEN, adminstring); } else return SendClientMessage(playerid,-1,"*"COL_LGREEN" Nici un admin online"); } return 1; }
CMD:forumname(playerid,params[]) { if(pInfo[playerid][pAdminLevel] >= 5) { new targetid,nume,string[180]; if(sscanf(params, "ud", targetid, nume)) return SendClientMessage(playerid,-1,""chat" /forumname [playerid] [nume]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online"); pInfo[targetid][ForumName] = nume; format(string, sizeof(string), "*"COL_RED" %s %s i-a setat numele de forum la %d lui %s",GetAdminName(playerid),PlayerName(playerid),nume,PlayerName(targetid)); SendMessageToAllAdmins(string, -1); } else { SendClientMessage(playerid,-1,"*"COL_RED" Nu esti autorizat sa folosesti comanda!"); } return 1; }
CMD:aduty(playerid, params[]) { if (pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,COLOR_WHITE, "Nu esti Admin."); if (!pInfo[playerid][pAdminDuty]) { SetPlayerColor(playerid,COLOR_PURPLE); SetPlayerSkin(playerid,280); pInfo[playerid][pAdminDuty] = 1; new string[128]; GetPlayerName(playerid, string, 24); format(string, sizeof(string), "{FF0000} %s este acum Admin Duty. Foloseste (/report) pentru a cere ajutor" ,string); SendClientMessageToAll(-1, string); } else { SetPlayerColor(playerid, COLOR_WHITE); SetPlayerSkin(playerid,NORMAL); pInfo[playerid][pAdminDuty] = 0; new str[76], name[24]; GetPlayerName(playerid, name, 24); format(str, sizeof(str), "{FF0000}%s nu mai este Admin Duty", name); SendClientMessageToAll(COLOR_GREEN, str); } return 1; }
: error 012: invalid function call, not a valid address : warning 215: expression has no effect : error 001: expected token: ";", but found ")" : error 029: invalid expression, assumed zero : fatal error 107: too many error messages on one line
Those errors you are getting are I think because you are using the wrong type of brackets. When accessing arrays use [ i ] not ( i ). So it would be PlayerName[i], ForumName[i], etc.
|
In forumname, if nume is a string, then you shouldn't be using %d in the format for it, nor should you be using d in sscanf for the command input of nume.
24 hour bumps only too. And what you're doing in that format in the first example in admins command, won't work as that's not how you use format, and pass things to SendClientMessage. Simply use 2 strings, and do 2 SendClientMessages. |
function Forumname(playerid,forumname[]) { new str[24],fname[16]; format(fname,sizeof(fname),"%s",ForumName); pInfo[ForumName] = fname; new stra[256]; format(stra,sizeof(stra),"*"COL_LGREEN" Admin %s(%i) has set your forumname to %s(%i)",PlayerName(playerid),playerid, ForumName); SendClientMessage(playerid,-1,stra); return 1; }
And what you're doing in that format in the first example in admins command, won't work as that's not how you use format, and pass things to SendClientMessage.
|
CMD:admins(playerid, params[])
{
if(pInfo[playerid][pHour] >= 0)
{
new adminstring[128];
new text[128];
if(IsPlayerConnected(playerid))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pAdminLevel] > 0)
{
format(adminstring, sizeof(adminstring),"%s %s / %s", GetAdminName(i), PlayerName(i), ForumName(i));
format(text, sizeof(text),"Administratori Online");
}
}
}
SendClientMessage(playerid,COLOR_WHITE, text);
SendClientMessage(playerid,COLOR_GREEN, adminstring);
}
//else return SendClientMessage(playerid,-1,"*"COL_LGREEN" Nici un admin online"); Currently this message it won't be showed to the players.
}
return 1;
}