19.08.2015, 08:49
Код:
CMD:groupmember(playerid,params[]) { new gname[30],pname[MAX_PLAYER_NAME+1],str[1024],str2[128],id, query[256]; if(sscanf(params,"s[30]",gname)) return SendClientMessage(playerid,-1,"/groupmember [group name]"); if(strlen(gname) > 30)return SendClientMessage(playerid,-1,"Name of group max is 30 Char"); new DBResult:result; id = DB_RetrieveKey(Group_Table,"GroupName",gname); if(id != DB_INVALID_KEY) { format(query, sizeof query, "SELECT * FROM `GroupMembers` WHERE `GroupName`='%s'", DB::Escape(gname)); result = DB::Query(query); for(new a;a<db_num_rows(result);a++) { db_get_field_assoc(result, "UserName", pname, sizeof pname); strcat(str,pname); strcat(str,"\n"); db_next_row(result); } format(str2,sizeof(str2),"Member Group : %s",gname); ShowPlayerDialog(playerid,DIALOG_GROUPMEMBER,DIALOG_STYLE_MSGBOX,str2,str,"Close",""); } else SendClientMessage(playerid,-1,"Invalid Group name"); return 1; }