deu no mesmo me dei adm reloguei no server mr.ovelha.ini >> level 0 entrei no sv dnv dei adm tentei usar cmd de adm e tb nгo foi !!!!
PHP код:
//==============================INCLUDES=============================//
#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <string>
#include <DOF2>
#define VERMELHO 0xFF0000C8
#define VERDE 0x00D200C8
#define Azul_C 0x00FFFFC8
#define COR_ERRO 0xFF0000C8
#define function::%0(%1) forward %0(%1);public %0(%1)
/******************************************************************************/
enum PlayerAdmin
{
Level
}
/******************************************************************************/
#define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
#pragma unused ret_memcpy
// Nametag
#define NAME_DRAWDISTANCE (5)
new Text3D:NameTag[MAX_PLAYERS];
#define Helper 1
#define Moderator 2
#define Admin 3
#define Developer 4
#define Master 5
#define Owner 6
/******************************************************************************/
new Text:Inicioserver[15];
new pAdmin[MAX_PLAYERS][PlayerAdmin];
/******************************************************************************/
main()
{
print("\n----------------------------------");
print(" Gamemode by Jefferson");
print("----------------------------------\n");
}
/******************************************************************************/
// New's
public OnGameModeInit()
{
SetWeather(11);
UsePlayerPedAnims();
SetGameModeText("Test");
// fs
print("\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
print(" DJ.PEROBA TOCANDO AS MELHORES TUTS TUTS");
print(" Creditos: JEFFERSON");
print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
//====================================================
Inicioserver[0] = TextDrawCreate(29.000000, 154.000000, "Penis");
TextDrawBackgroundColor(Inicioserver[0], 255);
TextDrawFont(Inicioserver[0], 3);
TextDrawLetterSize(Inicioserver[0], 0.769999, 3.899997);
TextDrawColor(Inicioserver[0], -1);
TextDrawSetOutline(Inicioserver[0], 1);
TextDrawSetProportional(Inicioserver[0], 1);
Inicioserver[1] = TextDrawCreate(28.000000, 188.000000, "Valdo");
TextDrawBackgroundColor(Inicioserver[1], 255);
TextDrawFont(Inicioserver[1], 1);
TextDrawLetterSize(Inicioserver[1], 0.619998, 2.599998);
TextDrawColor(Inicioserver[1], -1);
TextDrawSetOutline(Inicioserver[1], 1);
TextDrawSetProportional(Inicioserver[1], 1);
Inicioserver[2] = TextDrawCreate(108.000000, 188.000000, "16");
TextDrawBackgroundColor(Inicioserver[2], 255);
TextDrawFont(Inicioserver[2], 1);
TextDrawLetterSize(Inicioserver[2], 0.550000, 2.700001);
TextDrawColor(Inicioserver[2], -1);
TextDrawSetOutline(Inicioserver[2], 1);
TextDrawSetProportional(Inicioserver[2], 1);
Inicioserver[13] = TextDrawCreate(644.000000, 355.000000, "_");
TextDrawFont(Inicioserver[13], 1);
TextDrawLetterSize(Inicioserver[13], 0.500000, -0.099999);
TextDrawColor(Inicioserver[13], -1);
TextDrawSetOutline(Inicioserver[13], 0);
TextDrawSetProportional(Inicioserver[13], 1);
TextDrawSetShadow(Inicioserver[13], 1);
TextDrawUseBox(Inicioserver[13], 1);
TextDrawBoxColor(Inicioserver[13], 396367716);
TextDrawTextSize(Inicioserver[13], -4.000000, 0.000000);
Inicioserver[14] = TextDrawCreate(644.000000, 67.000000, "_");
TextDrawBackgroundColor(Inicioserver[14], 255);
TextDrawFont(Inicioserver[14], 1);
TextDrawLetterSize(Inicioserver[14], 0.500000, -0.099999);
TextDrawColor(Inicioserver[14], -1);
TextDrawSetOutline(Inicioserver[14], 0);
TextDrawSetProportional(Inicioserver[14], 1);
TextDrawSetShadow(Inicioserver[14], 1);
TextDrawUseBox(Inicioserver[14], 1);
TextDrawBoxColor(Inicioserver[14], 396367716);
TextDrawTextSize(Inicioserver[14], -4.000000, 0.000000);
TextDrawSetSelectable(Inicioserver[14], 0);
Inicioserver[3] = TextDrawCreate(644.000000, 2.000000, "_");
TextDrawBackgroundColor(Inicioserver[3], 255);
TextDrawFont(Inicioserver[3], 1);
TextDrawLetterSize(Inicioserver[3], 0.500000, 6.800000);
TextDrawColor(Inicioserver[3], -1);
TextDrawSetOutline(Inicioserver[3], 0);
TextDrawSetProportional(Inicioserver[3], 1);
TextDrawSetShadow(Inicioserver[3], 1);
TextDrawUseBox(Inicioserver[3], 1);
TextDrawBoxColor(Inicioserver[3], 33686116);
TextDrawTextSize(Inicioserver[3], -4.000000, 0.000000);
Inicioserver[4] = TextDrawCreate(644.000000, 358.000000, "_");
TextDrawBackgroundColor(Inicioserver[4], 255);
TextDrawFont(Inicioserver[4], 1);
TextDrawLetterSize(Inicioserver[4], 0.500000, 10.000002);
TextDrawColor(Inicioserver[4], -1);
TextDrawSetOutline(Inicioserver[4], 0);
TextDrawSetProportional(Inicioserver[4], 1);
TextDrawSetShadow(Inicioserver[4], 1);
TextDrawUseBox(Inicioserver[4], 1);
TextDrawBoxColor(Inicioserver[4], 33686116);
TextDrawTextSize(Inicioserver[4], -4.000000, 0.000000);
//============
//fs
return 1;
}
public OnGameModeExit()
{
DOF2_Exit();
return 1;
}
public OnPlayerConnect(playerid)
{
for(new txd = 0; txd <= 16; txd++) TextDrawShowForPlayer(playerid, Inicioserver[txd]);
//++++++++++++++++++++++++++++ NAME LABEL --------------------------------------------------
new string[128];
format(string, sizeof(string), "%s (%d)", p_name(playerid));
NameTag[playerid] = Create3DTextLabel(string, 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 3 );
Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2);
//++++++++++++++++++++++++++++ NAME LABEL --------------------------------------------------
return 1;
}
public OnPlayerSpawn(playerid)
{
for(new txd = 0; txd <= 16; txd++) TextDrawHideForPlayer(playerid, Inicioserver[txd]);
// admin
new arquivi[34], nomeplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomeplayer, sizeof(nomeplayer));
format(arquivi, sizeof(arquivi), "Admins/%s.ini", nomeplayer);
pAdmin[playerid][Level] = DOF2_GetInt(arquivi, "Level");
// admin
return 1;
}
public OnPlayerDisconnect(playerid)
{
// admin
new arquiva[34], playernome[MAX_PLAYER_NAME];
GetPlayerName(playerid, playernome, sizeof(playernome));
format(arquiva, sizeof(arquiva), "Admins/%s.ini", playernome);
if(DOF2_FileExists(arquiva))
{
DOF2_SetInt(arquiva, "Level", pAdmin[playerid][Level]);
DOF2_SaveFile();
}
else
{
DOF2_CreateFile(arquiva);
DOF2_SetInt(arquiva, "Level", pAdmin[playerid][Level]);
DOF2_SaveFile();
}
// admin
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SpawnPlayer(playerid);
SetPlayerCameraPos(playerid, -2551.77, 2751.12, 130.06);
SetPlayerCameraLookAt(playerid, -2557.27, 2748.87, 129.20);
return 1;
}
/////////////////////////////////////COMANDOS/////////////////////////////////////////////
CMD:gl(playerid,params[]){
new texto[128],string[230];
if(sscanf(params,"s[128]",texto))
return SendClientMessage(playerid,-1,"Use: /global [texto]");
format(string,230,"(( GLOBAL )): %s: %s",Nome(playerid),texto);
SendClientMessageToAll(-1,string);
return 1;
}
CMD:slap(playerid, params[])
{
new Players, string[128], reason[128];
if(sscanf(params, "us", Players, reason)) return SendClientMessage(playerid, COR_ERRO, "SERVER: /slap [playerid] [reason]");
if(pAdmin[playerid][Level] < 2) return SendClientMessage(playerid, COR_ERRO, "ERROR: You do not have permission.");
if(pAdmin[playerid][Level] < 1) return SendClientMessage(playerid, VERMELHO, "ERROR: You do not have permission.");
if(Players == INVALID_PLAYER_ID) return SendClientMessage(playerid, COR_ERRO, "ERROR: Invalid player ID.");
new Float:X, Float:Y, Float:Z;
GetPlayerPos(Players, X, Y, Z);
SetPlayerPos(Players, X, Y, Z+9);
format(string, sizeof(string), "SERVER: Administrator: {FFFFFF}%s(%d) {d42525}has slapped you. (Reason: {FFFFFF}%s{d42525} )", p_name(playerid), playerid, reason);
SendClientMessage(Players,COR_ERRO,string);
return 1;
}
CMD:setadmin(playerid, params[])
{
new id, level, string[256], string2[256], ganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAD0000AA, "{00E5FF}Vocк nгo estб autorizado.");
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, 0xAD0000AA, "Use /daradmin [ID] [LEVEL]");
if (level < 0 || level > 6) return SendClientMessage(playerid, 0xFF0000FF, "Level invбlido. Use de 1 б 6 .");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xAD0000AA, "Este jogador nгo estб online.");
GetPlayerName(id, ganhou, sizeof(ganhou));
GetPlayerName(playerid, deu, sizeof(deu));
format(string, sizeof(string), "Vocк deu admin level %s para o %s", GetLevelAdmin(level), ganhou);
SendClientMessage(playerid, 0x00F6F6AA, string);
format(string2, sizeof(string2), "O admin %s deu admin level %s para vocк.", deu , GetLevelAdmin(level));
SendClientMessage(id, VERDE, string2);
pAdmin[id][Level] = level;
save_player(id);
return 1;
}
CMD:lockadmin(playerid, params[])
{
new id, player[MAX_PLAYER_NAME], tirou[MAX_PLAYER_NAME], string[256], string2[256];
if (pAdmin[playerid][Level] != 5) return SendClientMessage(playerid, 0xAD0000AA, "Vocк nгo estб autorizado.");
if (sscanf(params, "u", id)) return SendClientMessage(playerid, 0xAD0000AA, "Use /tiraradmin [ID] ");
if (pAdmin[id][Level] < 1) return SendClientMessage(playerid, VERMELHO, "Este player nгo й admin ! ");
GetPlayerName(id, player, sizeof(player));
GetPlayerName(playerid, tirou, sizeof(tirou));
format(string, sizeof(string), "Vocк tirou o admin do %s", player);
SendClientMessage(playerid, 0x00F6F6AA, string);
format(string2, sizeof(string2), "O admin %s tirou seu admin.", tirou);
SendClientMessage(id, VERDE, string2);
pAdmin[playerid][Level] = 0;
return 1;
}
CMD:get(playerid, params[])
{
if(pAdmin[playerid][Level] < 1) return SendClientMessage(playerid, VERMELHO,"Vocк nгo estб autorizado.");
new id, Float: x, Float: y, Float: z, string[256], string2[256], namep[MAX_PLAYER_NAME], namead[MAX_PLAYER_NAME];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, VERMELHO,"Use /trazer [ID]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, VERMELHO,"Este jogador nгo estб online.");
GetPlayerName(playerid, namead, sizeof(namead));
GetPlayerName(id, namep, sizeof(namep));
format(string, sizeof(string), "Trouxe o player %s atй vocк.", namep);
format(string2, sizeof(string2), "The Administrator %s trouxe vocк atй ele.", namead);
SendClientMessage(playerid, Azul_C, string);
SendClientMessage(id, VERDE, string2);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(id, x+1, y+1, z);
return 1;
}
CMD:killp(playerid, params[])
{
new vida;
new playeryd, str[128], reason[128];
if(pAdmin[playerid][Level] < 1) return SendClientMessage(playerid, VERMELHO,"Vocк nгo estб autorizado.");
if(sscanf(params, "ds", vida)) return SendClientMessage(playerid, Azul_C, " /killp [ID] [REASON]");
if(!IsPlayerConnected(playeryd)) return SendClientMessage(playerid, -1, "[ERROR]: Player not found");
//fomart(str, sizeof(str), "SERVER: Administrator: {FFFFFF}%s(%d) {d42525}has slapped you. (Reason: {FFFFFF}%s{d42525} )",
format(str, sizeof(str), "SERVER: Administrator: {FFFFFF}%s(%d) {d42525}has killed you. (Reason: {FFFFFF}%s{d42525} )", p_name(playerid), playerid, reason);
SendClientMessage(playeryd,COR_ERRO,str);
return 1;
}
CMD:ride(playerid, params[])
{
new id = strval(params);
new plid;
new numero;
new playeryd;
new VehicleID;
if(pAdmin[playerid][Level] < 1) return SendClientMessage(playerid, VERMELHO,"Vocк nгo estб autorizado.");
if(sscanf(params, "d", playeryd, numero)) return SendClientMessage(playerid, -1, "[ERROR]: Incorrect: /ride [ID].");
if(id == playerid) return SendClientMessage(playerid, 0xFF0000AA, "You can not go yourself !!!");
if(!IsPlayerConnected(playeryd)) return SendClientMessage(playerid, -1, "[ERROR]: Player not found");
VehicleID = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid,VehicleID,1);
SendClientMessage(plid, -1, " | INFO | successfully performed command");
return 1;
}
/////////////////////////////////////COMANDOS/////////////////////////////////////////////
/***************************** *************************************************/
forward Kicka(p); public Kicka(p) {
#undef Kick
Kick(p);
#define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
return 1;
}
Nome(playerid){
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,24);
return name;
}
/******************************************************************************/
stock GetLevelAdmin(levelid)
{
new str[50];
if(levelid == 1)
{
str = "1";
}
else if (levelid == 2)
{
str = "2";
}
else if (levelid == 3)
{
str = "3";
}
else if (levelid == 4)
{
str = "4";
}
else if (levelid == 6)
{
str = "5";
}
else if (levelid == 5)
{
str = "6";
}
return str;
}
stock p_name( playerid )
{
new p_namev[MAX_PLAYER_NAME];
GetPlayerName(playerid, p_namev, MAX_PLAYER_NAME);
return p_namev;
}
function::save_player(playerid)
{
new nome_player[MAX_PLAYER_NAME];
new arquivo[34];
GetPlayerName(playerid, nome_player, sizeof(nome_player));
format(arquivo, sizeof(arquivo), "Admins/%s.ini", nome_player);
if(!DOF2_FileExists(arquivo))
DOF2_CreateFile(arquivo);
if(DOF2_FileExists(arquivo))
DOF2_SetInt(arquivo, "Level", pAdmin[playerid][Level]);
DOF2_SaveFile();
return 1;
}