[Ajuda] Ajudaaaaa - Minha Orimeira Gm
#1

Gente nao sei uq que deu tava seguindo um tuto antigo na internet pra aprender, e aparece varios erros nгo sei oque deu de errado , vejam

script
Код:
#include <a_samp>
#include <streamer>
#include <zcmd>
#include <DOF2>
#include <sscanf2>
#define PASTA_CONTAS                                                            "contas/%s.ini"
#define DIALOG_LOGIN                                                            1
#define DIALOG_REGISTO                                                          2

forward KickP(playerid);
forward KickP2(playerid);

enum pInfo  {
    Admin
}

new Tentativas[MAX_PLAYERS];
new PlayerInfo[MAX_PLAYERS][pInfo];



main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(3,1480.9451,-1752.4390,15.4453,357.1432,0,0,0,0,0,0);
    AddPlayerClass(7,1480.9451,-1752.4390,15.4453,357.1432,0,0,0,0,0,0);
    AddPlayerClass(18,1480.9451,-1752.4390,15.4453,357.1432,0,0,0,0,0,0);


	return 1;
}

public OnGameModeExit()
{
    DOF2_Exit();

	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, -1973.4938,160.2673,27.6940);
	SetPlayerCameraPos(playerid, -1973.1077,156.8675,27.6940);
	SetPlayerCameraLookAt(playerid,  -1973.4938,160.2673,27.6940);
    new string[300];
    if(DOF2_FileExists(PlayerConta(playerid)))
    {
        // DIALOG LOGIN
        format(string, sizeof(string), " {FFFFFF} Olб Bem Vindo de Volta {FF0000} %s {FFFFFF}  !\n\nDigite Sua Senha pra logar ", PlayerName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "San Andreas Brasileira-Seja Bem vido Novamente", string, "Logar", "Sair");

    }
    else
    {

        // DIALOG REGISTRO
        format(string, sizeof(string),"{FFFFFF} Olб Bem Vindo de Volta {FF0000}%s {FFFFFF}  !\n\nDigite Sua Senha para Registrar ", PlayerName(playerid));
         ShowPlayerDialog(playerid, DIALOG_REGISTO , DIALOG_STYLE_INPUT, "San Andreas Brasileira-Seja Bem vindo ", string, "Registrar", "Sair");

    }
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    DOF2_SetInt(PlayerConta(playerid), "Dinheiro", GetPlayerMoney(playerid));
    DOF2_SetInt(PlayerConta(playerid), "Level", GetPlayerScore(playerid));
    DOF2_SetInt(PlayerConta(playerid), "Admin", PlayerInfo[playerid][Admin]);
    DOF2_SaveFile();


	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{   new string[350],

    switch(dialogid)
        {
         case DIALOG_LOGIN: {
            if(strcmp(inputtext, DOF2_GetString(PlayerConta(playerid), "senha"),true) == 0) {
                SendClientMessage(playerid, 0x00FF00AA, "Logado Com Sucesso");
                CarregarContas(playerid);

                SpawnPlayer(playerid);
                return 1 ;
            } else {
                if(Tentativas[playerid] == 3) {
                    format(string, sizeof(string), " %s Foi Kickado Por Errar a Senha (%d) Vezes", PlayerName(playerid), (Tentativas[playerid]+1));
                    SendClientMessageToAll(0xFF7171AA, string);
                    KickP(playerid);
                    return 1;
                    } else {
                        Tentativas[playerid]++;
                        format(string, sizeof(string), "Senha Incorreta! (Tentativas %d/3)", Tentativas[playerid]);
                        SendClientMessage(playerid, 0xFF0000AA, string);
                        format(string, sizeof(string), "{#FFFFFF}Olб Bem Vindo de Volta {#FF0000}%s {#FFFFFF} !\n\nDigite Sua Senha pra logar ", PlayerName(playerid));
                        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "San Andreas Brasileira-Seja Bem vido Novamente", string, "Logar", "Sair");
                }
            }
        }
        case DIALOG_REGISTO: {
            if(!strlen(inputtext)) {
                format(string, sizeof(string), "{#FFFFFF}Olб Bem Vindo  {#FF0000}%s {#FFFFFF} !\n\nDigite Sua Senha para Registrar ", PlayerName(playerid));
                ShowPlayerDialog(playerid, DIALOG_REGISTO , DIALOG_STYLE_INPUT, "San Andreas Brasileira-Seja Bem vindo ", string, "Registrar", "Sair");

            }
            else
            {
                if(!DOF2_FileExists(PlayerConta(playerid)))
                {
                DOF2_CreateFile(PlayerConta(playerid);
                DOF2_SetString(PlayerConta(playerid), "Senha", inputtext);
                DOF2_SetInt(PlayerConta(playerid), "Level", 0);
                DOF2_SetInt(PlayerConta(playerid), Dinheiro", 5000);
                DOF2_SaveFile();
                SendClientMessage(playerid, 0x00FF00AA, "Seu Registro Foi Efetuado com Sucesso!");
                SpawnPlayer(playerid);
                return 1;
                }
            }
        }
    }
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
stock PlayerName(playerid)
{
new aname[MAX_PLAYER_NAME];
    GetPlayerName (playerid, aname, sizeof(aname));
    return aname;
}
public KickP(playerid)  { SetTimerEx("KickP2", 2000, false, "1", playerid); }

public KickP2(playerid) {return Kick(playerid)
{

}

 CMD:setadmin(playerid, params[]) {
    new idplayer,   string[124], level, texto[45];
    if(PlayerInfo[playerinfo][Admin] == 3 && !IsPlayerAdmin(playerid)) return SendClienMessage(playerid, -1, "[ERRO] {FF0000} Vocк Nгo Tem Acesso a este Comando ");
    if(sscanf(params, "dd", idplayer, level)) return SendCientMessage(pleyerid, -1 ,"[ERRO] {FF0000} use: /setadmin [ playerid ] [level 1 - 3] ");
    if(!IsPlayerConnected(idplayer)) return SendClientMessage(playerid, -1, " [ ERRO ] {FF0000} Este Player nгo esta conectado   " );
    if(level >= 4) return SendClientMessage(playerid, -1, "[ERRO] {FF0000} use: /setadmin [ playerid ] [level 1 - 3]");
    PlayerInfo[idplayer][Admin] = Level;
    DOF2_SetInt(PlayerConta(idplayer), "Admin", level);
    switch(level) {
        case 0: texto = "Removeu";
        case 1: texto = "Definiu como Moderador";
        case 2: texto = "Definiu Adm";
        case 3: texto = "Setou como Dono";
        }
        format(string, sizeof(string), "[ SERVER ] O %s Te %s Da Administraзгo do Servidor", PlayerName(playerid), texto-);
        SendClientMessage(idplayer, 0xFFFF00AA, string);
        if(level == 0)  format(string, sizeof(string), "[ SERVER ] Vocк Removeu %s Da Administraзгo do Servidor", PlayerName(idplayer));
        else format(string, sizeof(string), "[ SERVER ] Vocк %s Te %s Da Administraзгo do Servidor", texto, PlayerName(idplayer));
        SendClientMessage(idplayer, 0xFFFF00AA, string);
        return 1;
}

stock PlayerConta(playerid) {
    new file[50];
    format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
    return file;
}

stock CarregarContas(playerid)  {
 GivePlayerMoney(playerid, DOF2_GetInt(PlayerConta(playerid), "Dinheiro"));
 SetPlayerScore(playerid, GetPlayerScore(playerid)+DOF2_GetInt(PlayerConta(playerid), "Level"));
 PlayerInfo[playerid][Admin] = DOF2_GetInt(PlayerConta(playerid), "Admin");
 SendClientMessage(playerid, 0x00FF40AA, "[SERVER] Conta Carregada Com Sucesso ");


}
Error (erro)

Reply
#2

Vocк esqueceu de colocar uma aspa dupla.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)