[Ajuda] Gamemode (Salvamento)
#1

Galera veem pra mim se este sistema de salvamento estб correto:

Para Dar ADM:
pawn Код:
if(strcmp(cmd,"/setadmin", true)==0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    if(pAdmin[playerid] == 6 || IsPlayerAdmin(playerid))
    {
        new plid, leveladm;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, Vermelho, "(INFO) Digite: /setadmin [id] [Level]");
            return 1;
        }
        plid = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "(INFO) Digite: /setadmin [id] [Level]");
            return 1;
        }
        leveladm = strval(tmp);
        if(leveladm>=7)
        {
            SendClientMessage(playerid, Vermelho, "(INFO) Niveis permitidos: 0 a 6.");
            return 1;
        }
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        if(IsPlayerConnected(plid)) {
            if(leveladm>=1) {
                pAdmin[plid] = leveladm;
                dini_IntSet(file, "LevelAdmin",leveladm);
                format(string, sizeof(string), "(INFO) O Admin Rcon %s (%d) (») Promoveu: %s (%d) para administrador (») Level: %d", aname,playerid,pname,plid,leveladm);
                SendClientMessageToAll(tcadm, string);
                format(string, sizeof(string), "{00FF7F}(INFO) Vocк foi promovido a Admin Level %d por : %s!", leveladm,aname);
                SendClientMessage(plid,-1, string);
                SetPlayerSkin(plid,217);
                if(leveladm>1) {
                //-x
                }
            }
            if(leveladm == 0)
            {
                pAdmin[plid] = 0;
                dini_IntSet(file, "LevelAdmin",0);
                format(string, sizeof(string), "(INFO) O Admin Rcon %s (%d) (») Retirou admin do jogador: %s (ID: %d)", aname,playerid,pname,plid);
                SendClientMessageToAll(tcadm, string);
                format(string, sizeof(string), "{00FF7F}(INFO) %s , retirou seu admin!",aname);
                SendClientMessage(plid,-1, string);
                SetPlayerSkin(plid,0);
                if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
            }
            return 1;
        }
        else {
            SendClientMessage(playerid, Vermelho, "(INFO) Jogador nгo conectado.");
            return 1;
        }
    }
}
pawn Код:
public OnPlayerConnect(playerid)
{
TogglePlayerSpectating(playerid, true);
ForceClassSelection(playerid);
SetPVarInt(playerid, "Intro", 0);
SetTimerEx("ShowIntro", 1000, 0, "d", playerid);
blockpm[playerid] = 0;
PlayerInfo[playerid][LoginsFalsos] = 0;
pAdmin[playerid] = 0;
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
dini_IntSet(file, "DM", 0);
TextDrawShowForPlayer(playerid, topblack);
TextDrawShowForPlayer(playerid, backblack);
CPSERVICE_actualcp[playerid] = 0;
AFK[playerid]=0;
multar[playerid]= 0;
autoescola[playerid] = 0;
nogame[playerid] = 0;
noevento[playerid] = 0;
PlayerInfo[playerid][Logged] = 0;
vip[playerid] = 0;
guard[playerid] = 0;
GPS_Spawned[playerid] = 0;
DMLiberado[playerid] = 0;
Mute[playerid] = 0;
SpawnPlayer(playerid);
//news
new Pname[MAX_PLAYER_NAME];
new string[256];
new sstring[256];
//============================================================================================================
if(dini_Int("nickban.ini",PlayerName(playerid)) == 1)
{
SendClientMessage(playerid, 0x11B1FFAA, "Vocк foi banido Motivo: Vocк estб banido!");
format(sstring, sizeof(sstring), "%s (%d) Foi banido |Motivo|: Conta estб banida!", aname,playerid);
SendClientMessageToAll(0x11B1FFAA, sstring);
Kick(playerid);
return 1;
}
if(dini_Int("banidos.ini",PlayerName(playerid)) == 1)
{
SendClientMessage(playerid, 0x11B1FFAA, "Vocк foi kickado |Motivo|: Conta estб banida!");
format(sstring, sizeof(sstring), "%s (%d) Foi kickado |Motivo|: Conta estб banida", aname,playerid);
SendClientMessageToAll(0x11B1FFAA, sstring);
Kick(playerid);
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
StopAudioStreamForPlayer(playerid);
new aname[MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
new Pname[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"Contas/%s.ini",name);
new grana;
grana = GetPlayerMoney(playerid);
dini_IntSet(file, "Dinheiro", grana);
dini_IntSet(file, "LevelAdmin", pAdmin[playerid]);
GetPlayerName(playerid, Pname, sizeof(Pname));
switch(reason)
{
case 0: format(string, sizeof(string), "» %s saiu do servidor (Queda de conexгo)", Pname);
case 1: format(string, sizeof(string), "» %s saiu do servidor (Vontade Prуpria)", Pname);
case 2: format(string, sizeof(string), "» %s saiu do servidor (Kickado ou Banido)", Pname);
}
Mute[playerid] = 0;
SendClientMessageToAll(C_Temac, string);
TextDrawHideForPlayer(playerid, Relogio);
new Interior;
Interior = GetPlayerInterior(playerid);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CPSERVICE_actualcp[playerid] = 0;
dini_IntSet(file, "Dinheiro", grana);
dini_IntSet(file,"Continuar",1);
dini_FloatSet(file,"ContinuarX",Float:X);
dini_FloatSet(file,"ContinuarY",Float:Y);
dini_FloatSet(file,"ContinuarZ",Float:Z);
dini_IntSet(file,"ContinuarI",Interior);
dini_IntSet(file, "convitent", 0);
dini_IntSet(file, "Entrevista", 0);
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5 || pAdmin[playerid] == 6)
{
new AdminName[MAX_PLAYER_NAME];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
format(string, sizeof(string), "~w~%s: ~r~ADM ~p~OFFLINE", AdminName);
for(new i=0; i<MAX_PLAYERS; i++)
{
GameTextForPlayer(i, string , 5000, 3);
}
}
if(InCall[playerid]==1)
{
if(playerid==sender)
{
InCall[gc]=0,GetCall[gc]=0; InCall[sender]=0,GetCall[sender]=0;
SetPlayerSpecialAction(gc,SPECIAL_ACTION_STOPUSECELLPHONE);
format(str3,128,"%s desligou o celular!",GetName(sender));
SendClientMessage(gc,GRAY,str3);
} else if(playerid == gc)
{
InCall[gc]=0,GetCall[gc]=0; InCall[sender]=0,GetCall[sender]=0;
SetPlayerSpecialAction(sender,SPECIAL_ACTION_STOPUSECELLPHONE);
format(str3,128,"%s estб fora de area por sair da Cidade!",GetName(gc));
SendClientMessage(sender,GRAY,str3);
}
}
minutos[playerid] = 0;
Conversa[playerid] = 0;
NaFaculdade[playerid] = 0;
return 1;
}
Poderia Trocar meu OnPlayerConnect por este:
pawn Код:
public OnPlayerConnect(playerid)
{
new aname[MAX_PLAYER_NAME]; // COLOQUEI DAQUI
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"Contas/%s.ini",name);
new grana;
grana = GetPlayerMoney(playerid);
dini_IntSet(file, "Dinheiro", grana);
dini_IntSet(file, "LevelAdmin", pAdmin[playerid]); // ATЙ AQUI
TogglePlayerSpectating(playerid, true);
ForceClassSelection(playerid);
SetPVarInt(playerid, "Intro", 0);
SetTimerEx("ShowIntro", 1000, 0, "d", playerid);
blockpm[playerid] = 0;
PlayerInfo[playerid][LoginsFalsos] = 0;
//pAdmin[playerid] = 0; - TIREI ESSE
//new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
dini_IntSet(file, "DM", 0);
TextDrawShowForPlayer(playerid, topblack);
TextDrawShowForPlayer(playerid, backblack);
CPSERVICE_actualcp[playerid] = 0;
AFK[playerid]=0;
multar[playerid]= 0;
autoescola[playerid] = 0;
nogame[playerid] = 0;
noevento[playerid] = 0;
PlayerInfo[playerid][Logged] = 0;
vip[playerid] = 0;
guard[playerid] = 0;
GPS_Spawned[playerid] = 0;
DMLiberado[playerid] = 0;
Mute[playerid] = 0;
SpawnPlayer(playerid);
//news
new Pname[MAX_PLAYER_NAME];
new string[256];
new sstring[256];
//============================================================================================================
if(dini_Int("nickban.ini",PlayerName(playerid)) == 1)
{
SendClientMessage(playerid, 0x11B1FFAA, "Vocк foi banido Motivo: Vocк estб banido!");
format(sstring, sizeof(sstring), "%s (%d) Foi banido |Motivo|: Conta estб banida!", aname,playerid);
SendClientMessageToAll(0x11B1FFAA, sstring);
Kick(playerid);
return 1;
}
if(dini_Int("banidos.ini",PlayerName(playerid)) == 1)
{
SendClientMessage(playerid, 0x11B1FFAA, "Vocк foi kickado |Motivo|: Conta estб banida!");
format(sstring, sizeof(sstring), "%s (%d) Foi kickado |Motivo|: Conta estб banida", aname,playerid);
SendClientMessageToAll(0x11B1FFAA, sstring);
Kick(playerid);
return 1;
}
Reply


Messages In This Thread
[Ajuda] Gamemode (Salvamento) - by GuiihCamargo - 10.03.2012, 09:06
Re: [DЪVIDA] Gamemode (Salvamento) - by humildadeforever - 10.03.2012, 10:34
Re: [DЪVIDA] Gamemode (Salvamento) - by GuiihCamargo - 10.03.2012, 11:09
Re: [DЪVIDA] Gamemode (Salvamento) - by humildadeforever - 10.03.2012, 12:32
Re: [DЪVIDA] Gamemode (Salvamento) - by GuiihCamargo - 10.03.2012, 12:36

Forum Jump:


Users browsing this thread: 1 Guest(s)