RSSy MYGO.pl Opublikowano Kwiecień 5, 2022 o 11:05 RSSy Udostępnij Opublikowano Kwiecień 5, 2022 o 11:05 Hello guys i want a plugin which funtion is to save the teams with command /save & when you change the map to load all save players in the team they were saved. I hope you understand me, thanks! It can be used as stock too PHP Code: public SavePlayers(TeamName:team_winners) { new JSON:root_array = json_init_array(); new iPlayers[MAX_PLAYERS], iNum, szAuth[24]; get_players(iPlayers, iNum, "c"); for(new i; i < iNum; i++) { new id = iPlayers[i]; if(rg_get_user_team(id) == TEAM_SPECTATOR) continue; get_user_authid(id, szAuth, charsmax(szAuth)); ArrayAppendValue(root_array, json_init_string(fmt("player_%i", i+1))); new JSON:object = json_init_object(); json_object_set_string(object, "player_auth", fmt("%s", szAuth)); new TeamName:iTeam = TeamName:rg_get_user_team(id) == team_winners ? TEAM_TERRORIST : TEAM_CT; json_object_set_number(object, "player_team", _:iTeam); ArrayAppendValue(root_array, object); json_free(object); } json_serial_to_string(root_array, g_sBuffer, charsmax(g_sBuffer), true); server_print("Players saved (%d bytes)", json_serial_size(root_array, true)); json_free(root_array); } ArrayAppendValue(JSON:array, JSON:node) { json_array_append_value(array, node); json_free(node); } Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi