Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:marketing(playerid,params[])
- {
- if(pLoggedIn[playerid] == 0) return SendClientMessage(playerid,COLOR_GREY,"Niste prijavljeni!");
- mysql_function_query(SQLConn,"SELECT `pUsername`,`pMarketing`,,`pIsOnline` FROM `users` WHERE `pMarketing` > '0' ORDER BY `pMarketing` DESC",true,"LoadStaffStatusQuery1","i",playerid);
- return 1;
- }
- forward LoadStaffStatusQuery1(playerid);
- public LoadStaffStatusQuery1(playerid)
- {
- new rows,fields;
- new tempStaffName[24];
- new tempStaffAdmin = 0;
- new tempStaffOnline = 0;
- new tempStaffID = INVALID_PLAYER_ID;
- new tempStaffAfk = 0;
- new tempStaffDuty = 0;
- new tempValue[3];
- new container[24 * 100];
- cache_get_data(rows,fields,SQLConn);
- if(rows)//ako ima clanova u administraciji, a normalno ima
- {
- for(new i; i < rows; i++)
- {
- //load data
- cache_get_field_content(i,"pUsername",tempStaffName,SQLConn);
- tempStaffAdmin = cache_get_field_content_int(i,"pMarketing",SQLConn);
- tempStaffOnline = cache_get_field_content_int(i,"pIsOnline",SQLConn);
- //check if online
- tempStaffID = GetIDFromName(tempStaffName);
- //check if on duty
- if(tempStaffID != INVALID_PLAYER_ID)//ako nije off vidi jel on duty i afk
- {
- if(AdminDuty[tempStaffID] != 0) tempStaffDuty = 1;
- else if(GmDuty[tempStaffID] != 0) tempStaffDuty = 2;
- else tempStaffDuty = 0;
- tempStaffAfk = IsPlayerAfk(tempStaffID);
- }
- else
- {
- tempStaffAfk = 0;
- tempStaffDuty = 0;
- }
- //check if afk
- //build the string
- if(tempStaffOnline == 1)
- {
- if(tempStaffAfk == 1) strcat(container,""LIGHTGREY"");//afk
- else if(tempStaffDuty == 0) strcat(container,""WHITE"");//online
- else if(tempStaffDuty == 1) strcat(container,""VAGOS"");//admin duty
- else if(tempStaffDuty == 2) strcat(container,""LIGHTBLUE"");//gm duty
- if(tempStaffAfk == 0) strcat(container,"[ON]\t\t");
- else if(tempStaffAfk == 1) strcat(container,"[AFK]\t\t");
- }
- else
- {
- strcat(container,""GREY"");//offline
- strcat(container,"[OFF]\t\t");
- }
- //Provjera statusa igraca
- //Provjera levela admina/gma
- if(tempStaffAdmin != 0)
- {
- valstr(tempValue,tempStaffAdmin);
- strcat(container,"[Marketing "),strcat(container,tempValue),strcat(container,"]\t\t");
- }
- if(tempStaffAdmin == 6)
- {
- valstr(tempValue,tempStaffAdmin);
- strcat(container,"[Marketing "),strcat(container,tempValue),strcat(container,"]\t\t");
- }
- strcat(container,tempStaffName);
- strcat(container,"\n");
- }
- ShowDialog(playerid,Show:StaffDialog,DIALOG_STYLE_MSGBOX,"BU-RP Marketing Team",container,"Ok","");
- }
- else SendClientMessage(playerid, -1, "Nema marketing tima na listi!");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement