Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Player Ranks COntrol
- Rank Dinâmico para Jogadores
- Como Utilizar:
- é tudo automático ele verifica o lvl do jogador e automaticamente define seu rank
- *NPCS São Ignorados pelo FS
- Requerimentos:
- Coloque Isso no Seu GameMode
- forward GetPlayerAdminLevel(playerid);
- forward GetPlayerLevel(playerid);
- //------------------------------------------------------------------------------------------------------
- public GetPlayerAdminLevel(playerid)
- {
- return PlayerInfo[playerid][pAdmin];
- }
- //-----------------------------------
- public GetPlayerLevel(playerid)
- {
- return PlayerInfo[playerid][pLevel];
- }
- */
- #define FILTERSCRIPT
- #include <a_samp>
- //-----------------------------------------------
- new pLevel;
- new pAdmLevel;
- new pName[MAX_PLAYER_NAME];
- public OnFilterScriptInit()
- {
- print("\n---------------------------");
- print("Player Ranks Script");
- print("Por Marcelo (KRYSKY)");
- print("---------------------------\n");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if (IsPlayerNPC(playerid))
- {
- //print("NPC IGNORADO!");
- return 1;
- }
- else
- {
- pAdmLevel = CallRemoteFunction("GetPlayerAdminLevel", "i", playerid);
- pLevel = CallRemoteFunction("GetPlayerLevel", "i", playerid);
- GetPlayerName(playerid,pName, sizeof(pName));
- new nPName[MAX_PLAYER_NAME];
- if (pLevel == 1)
- {
- if(strfind(pName,"[NOB]")!=0)
- {
- format(nPName, sizeof(nPName), "[NOB]%s", pName); //NoobS
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 2 && pLevel <= 9)
- {
- if(strfind(pName,"[APD]")!=0)
- {
- format(nPName, sizeof(nPName), "[APD]%s", pName); // Aprendiz
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 10 && pLevel <= 19)
- {
- if(strfind(pName,"[EXP]")!=0)
- {
- format(nPName, sizeof(nPName), "[EXP]%s", pName); // Experiente
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 20 && pLevel <= 39)
- {
- if(strfind(pName,"[PRO]")!=0)
- {
- format(nPName, sizeof(nPName), "[PRO]%s", pName); // Profissional
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 40 && pLevel <= 99)
- {
- if(strfind(pName,"[TEN]")!=0)
- {
- format(nPName, sizeof(nPName), "[TEN]%s", pName); // Tenente
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 100 && pLevel <= 199)
- {
- if(strfind(pName,"[CRL]")!=0)
- {
- format(nPName, sizeof(nPName), "[CRL]%s", pName); // Coronel
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 200 && pLevel <= 399)
- {
- if(strfind(pName,"[GEN]")!=0)
- {
- format(nPName, sizeof(nPName), "[GEN]%s", pName); // GENERAL
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 400 && pLevel <= 799)
- {
- if(strfind(pName,"[MAJ]")!=0)
- {
- format(nPName, sizeof(nPName), "[MAJ]%s", pName); // Major
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 800 && pLevel <= 999)
- {
- if(strfind(pName,"[ALM]")!=0)
- {
- format(nPName, sizeof(nPName), "[ALM]%s", pName); // Almirante
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel >= 1000) // Apartir de Agora Entra os Ranks para ADMs, GMs como eu Uso o GF, vc pode alterar o tirar fora
- {
- if (pAdmLevel == 1) // GM
- {
- if(strfind(pName,"[GM]")!=0)
- {
- format(nPName, sizeof(nPName), "[GM]%s", pName); // Game Master
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pAdmLevel == 2) // Administrador Lvl 1
- {
- if(strfind(pName,"[ADM1]")!=0)
- {
- format(nPName, sizeof(nPName), "[ADM1]%s", pName); // ADMIN LVL1
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pAdmLevel == 3) // Administrador Lvl 2
- {
- if(strfind(pName,"[ADM2]")!=0)
- {
- format(nPName, sizeof(nPName), "[ADM2]%s", pName); // ADMIN LVL2
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pAdmLevel == 4) // Administrador Lvl 3
- {
- if(strfind(pName,"[ADM]")!=0)
- {
- format(nPName, sizeof(nPName), "[ADM3]%s", pName); // ADMIN LVL3
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pAdmLevel == 5) // Administrador Lvl 4
- {
- if(strfind(pName,"[ADM4]")!=0)
- {
- format(nPName, sizeof(nPName), "[ADM4]%s", pName); // ADMIN LVL4
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pAdmLevel == 1337) // Administrador Geral
- {
- if(strfind(pName,"[ADM]")!=0)
- {
- format(nPName, sizeof(nPName), "[ADM]%s", pName); // ADMIN
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pAdmLevel == 1338) // Dono
- {
- if(strfind(pName,"[LDR]")!=0)
- {
- format(nPName, sizeof(nPName), "[LDR]%s", pName); // lider
- SetPlayerName(playerid, nPName);
- }
- }
- else if (pLevel == 1000) // Dono
- {
- if(strfind(pName,"[MAR]")!=0)
- {
- format(nPName, sizeof(nPName), "[MAR]%s", pName); // Marechal
- SetPlayerName(playerid, nPName);
- }
- }
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement