[AJUDA] gm
#1

Bom estou comeзando um RPG mas por algum motivo ele nao esta iniciando, alguem saberia dizer porque?
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <Dini>
#define CONTAS "Contas/%s.ini"//CONTAS DOS PLAYERS
#define BRANCO 0xFFFFFFAA
#define VERMELHO 0xE31919AA
#define AMARELO 0xF6F600AA
#define VERDE 0x007700AA
#define AZUL 0x0000BBAA
enum Info
{
    pTutorial,
    pMaconha,
    pCocaina,
    pCrack,
    pSafeMaconha,
    pSafeCocaina,
    pSafeCrack,
    pLevel,
    pIdade,
    pLider,
    pMembro,
    pAdmin,
    pHelper,
    pVip,
    pSocio
};
new PlayerInfo[MAX_PLAYERS][Info];
forward MSGAdmin(color, string[]);
public MSGAdmin(color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            SendClientMessage(i,color,string);
        }
    }
}
forward SetPlayerSpawn(playerid);
public SetPlayerSpawn(playerid)
{
    SetPlayerPos(playerid,679.5064,-3375.5085,16.1505);
    return 1;
}
forward IniciarTuto(playerid);//Settimer para inicio do tutorial
public OnGameModeInit()
{
    SendRconCommand("hostname [BR] Ultimate RPG v1.0");
    SendRconCommand("mapname Los Santos");
    SetGameModeText("ULT RPG v1.0");
    return 1;
}
public OnGameModeExit()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SalvarConta(i);
    }
    return 1;
}
// ONPLAYERCONNECT
public OnPlayerConnect(playerid)
{
    new str[100];
    format(str,100,CONTAS,pNome(playerid));
    if(!dini_Exists(str))
    {
        format(str,100,"%s Bem Vindo ao Ultimate RPG\nDigite Sua Senha Para se Registrar",pNome(playerid));
        ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registro",str,"Registrar","Cancelar");
    }
    else
    {
        format(str,100,"%s Bem Vindo ao Ultimate RPG\nDigite Sua Senha Para Logar!",pNome(playerid));
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login",str,"Logar","Cancelar");
    }
    return 1;
}
public OnPlayerDisconnect(playerid)
{
    SalvarConta(playerid);
    return 1;
}
//ONDIALOGRESPONSE
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new str[256];
    if(dialogid == 1)
    {
        if(response)
        {
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registro","Senha Invalida\nDigite Uma Senha Valida Para Continuar","Registrar","Cancelar");
            format(str,256,CONTAS,pNome(playerid));
            dini_Create(str);
            dini_Set(str,"Senha",inputtext);
            dini_IntSet(str,"Tutorial",0);
            dini_IntSet(str,"Dinheiro",0);
            dini_IntSet(str,"Level",PlayerInfo[playerid][pLevel]);
            dini_IntSet(str,"Maconha",PlayerInfo[playerid][pMaconha]);
            dini_IntSet(str,"Cocaina",PlayerInfo[playerid][pCocaina]);
            dini_IntSet(str,"Crack",PlayerInfo[playerid][pCrack]);
            dini_IntSet(str,"SafeMaconha",PlayerInfo[playerid][pSafeMaconha]);
            dini_IntSet(str,"SafeCocaina",PlayerInfo[playerid][pSafeCocaina]);
            dini_IntSet(str,"SafeCrack",PlayerInfo[playerid][pSafeCrack]);
            dini_IntSet(str,"AdminLevel",PlayerInfo[playerid][pAdmin]);
            dini_IntSet(str,"HelperLevel",PlayerInfo[playerid][pHelper]);
            dini_IntSet(str,"VIP",PlayerInfo[playerid][pVip]);
            dini_IntSet(str,"Socio",PlayerInfo[playerid][pSocio]);
            dini_IntSet(str,"Idade",PlayerInfo[playerid][pIdade]);
            format(str,256,"%s Conta Registrada Com Sucesso\nDigite Sua Senha Para Logar",pNome(playerid));
            ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login",str,"Logar","Cancelar");
            GivePlayerMoney(playerid,5000000);//5kk
            PlayerInfo[playerid][pLevel] = 5;
            SendClientMessage(playerid,-1,"Voce ganhou level 5 e 5kk por se registrar no servidor!");
            return 1;
        }
        else
        {
            SendClientMessage(playerid,-1,"Kickado Por Nao Registrar-se");
            Kick(playerid);
            return 1;
        }
    }
    if(dialogid == 2)
    {
        if(response)
        {
            if(!strlen(inputtext))
            {
                ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Senha Incorreta\nDigite Sua Verdadeira Senha Para Logar!","Logar","Cancelar");
                return 1;
            }
            format(str,256,CONTAS,pNome(playerid));
            if(!strcmp(inputtext,dini_Get(str,"Senha"),false))
            {
                CarregarConta(playerid);
                SpawnPlayer(playerid);
                return 1;
            }
            else
            {
                ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Senha Incorreta\nDigite Sua Verdadeira Senha Para Logar!","Logar","Cancelar");
            }
            return 1;
        }
        else
        {
            SendClientMessage(playerid,-1,"Kickado Por Nao Logar!");
            Kick(playerid);
            return 1;
        }
    }
    return 1;
}
public OnPlayerSpawn(playerid)
{
    SetPlayerSpawn(playerid);
    return 1;
}
//COMANDOS (ZCMD + SSCANF)
//COMANDOS DE ADMIN
CMD:kick(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new id,name[MAX_PLAYER_NAME],motivo[100],str[128];
        if(sscanf(params,"us[128]",id,motivo)) return SendClientMessage(playerid,-1,"Use /Kick [ID][Motivo]");
        if(strcmp(pNome(id),"Pedro_Miranda",true) == 0) return Kick(playerid);
        GetPlayerName(id,name,sizeof(name));
        format(str,128,"%s Foi Kickado Por %s, Motivo: %s",name,pNome(playerid),motivo);
        SendClientMessageToAll(VERMELHO,str);
        Kick(id);
    }
    return 1;
}
CMD:ir(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
    {
        new id,Float:x,Float:y,Float:z,idint;
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"Use /Ir [ID/Nome]");
        GetPlayerPos(id,x,y,z);
        idint = GetPlayerInterior(id);
        SetPlayerPos(playerid,x,y,z);
        SetPlayerInterior(playerid,idint);
    }
    return 1;
}
stock CarregarConta(playerid)
{
    new str[256];
    format(str,256,CONTAS,pNome(playerid));
    GivePlayerMoney(playerid, dini_Int(str,"Dinheiro"));
    PlayerInfo[playerid][pIdade] = dini_Int(str,"Idade");
    PlayerInfo[playerid][pAdmin] = dini_Int(str,"AdminLevel");
    PlayerInfo[playerid][pHelper] = dini_Int(str,"HelperLevel");
    PlayerInfo[playerid][pVip] = dini_Int(str,"VIP");
    PlayerInfo[playerid][pSocio] = dini_Int(str,"Socio");
    PlayerInfo[playerid][pMaconha] = dini_Int(str,"Maconha");
    PlayerInfo[playerid][pCocaina] = dini_Int(str,"Cocaina");
    PlayerInfo[playerid][pCrack] = dini_Int(str,"Crack");
    PlayerInfo[playerid][pSafeMaconha] = dini_Int(str,"SafeMaconha");
    PlayerInfo[playerid][pSafeCocaina] = dini_Int(str,"SafeCocaina");
    PlayerInfo[playerid][pSafeCrack] = dini_Int(str,"SafeCrack");
    PlayerInfo[playerid][pLevel] = dini_Int(str,"Level");
    PlayerInfo[playerid][pTutorial] = dini_Int(str,"Tutorial");
    return 1;
}
stock SalvarConta(playerid)
{
    new str[256];
    format(str,256,CONTAS,pNome(playerid));
    dini_IntSet(str,"Dinheiro", GetPlayerMoney(playerid));
    dini_IntSet(str,"Idade",PlayerInfo[playerid][pIdade]);
    dini_IntSet(str,"AdminLevel", PlayerInfo[playerid][pAdmin]);
    dini_IntSet(str,"HelperLevel", PlayerInfo[playerid][pHelper]);
    dini_IntSet(str,"VIP", PlayerInfo[playerid][pVip]);
    dini_IntSet(str,"Socio", PlayerInfo[playerid][pSocio]);
    dini_IntSet(str,"Maconha", PlayerInfo[playerid][pMaconha]);
    dini_IntSet(str,"Cocaina", PlayerInfo[playerid][pCocaina]);
    dini_IntSet(str,"Crack", PlayerInfo[playerid][pCrack]);
    dini_IntSet(str,"SafeMaconha", PlayerInfo[playerid][pSafeMaconha]);
    dini_IntSet(str,"SafeCocaina", PlayerInfo[playerid][pSafeCocaina]);
    dini_IntSet(str,"SafeCrack", PlayerInfo[playerid][pSafeCrack]);
    dini_IntSet(str,"Level", PlayerInfo[playerid][pLevel]);
    dini_IntSet(str,"Tutorial",PlayerInfo[playerid][pTutorial]);
    return 1;
}
stock pNome(playerid)
{
    new nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,nome,sizeof(nome));
    return nome;
}
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
    new str[128];
    if(!success) return SendClientMessage(playerid,-1,"Comando nгo Reconhecido.");
    if(success) return format(str,128,"O Jogador %s [ID: %d] Digitou o Comando %s",pNome(playerid),playerid,cmdtext); MSGAdmin(AZUL,str);
    return 1;
}
Reply


Messages In This Thread
[AJUDA] gm - by Jason` - 12.10.2011, 18:14
Re: [AJUDA] gm - by Lipe_Stronda - 12.10.2011, 18:20
Re: [AJUDA] gm - by Jason` - 12.10.2011, 18:26
Re: [AJUDA] gm - by Hardware - 12.10.2011, 18:28
Re: [AJUDA] gm - by Jason` - 12.10.2011, 18:32
Re: [AJUDA] gm - by Hardware - 12.10.2011, 18:34
Re: [AJUDA] gm - by Jason` - 12.10.2011, 18:37
Re: [AJUDA] gm - by Hardware - 12.10.2011, 18:40
Re: [AJUDA] gm - by Jason` - 12.10.2011, 18:41
Re: [AJUDA] gm - by Dolby - 12.10.2011, 18:42

Forum Jump:


Users browsing this thread: 2 Guest(s)