27.03.2014, 16:21
Bem, eu sou muito novato em pawno, quase comeзando agora praticamente, e eu tentei seguir o tutorial do sistema de login do EditPawn e meio que me embolei e deu alguns erros :// '
Vou postar meu GM todo pois ele й pequeno e nao tem nada demais.
Link do Tutorial: Clique aqui
Erros e Warning que o compilador acusou:
Espero que me ajudem e sem criticas pf, sou novato em Pawno :/ OBRIGADO!
Vou postar meu GM todo pois ele й pequeno e nao tem nada demais.
Link do Tutorial: Clique aqui
PHP код:
#include <a_samp>
#include <zcmd>
#include DOF2
//===================CORES=================//
#define COR_AMARELO 0xFFFF00FF
#define COR_AZUL 0x058AFFFF
#define COR_ROSA 0xFF05CDFF
#define COR_VERDE 0x33AA33AA
#define COR_BRANCO 0xFFFFFFAA
#define COR_VERMELHO 0xFFFFFFFF
#define COR_PRETO 0x000000FF
#define COR_CINZA 0x878787FF
#define COR_AZULCLARO 0x03F2FFFF
#define COR_VERDECLARO 0xFF0000FF
#define COR_ROXO 0x7D03FFFF
#define COR_ROXOCLARO 0x9A03FFFF
#define COR_LARANJA 0xFF7403FF
//===================CORES=================//
#define DIALOG_REGISTRO 1
#define DIALOG_LOGAR 2
enum Informacoes
{
Senha,
Matou,
Morreu,
Dinheiro
}
new Player[MAX_PLAYERS][Informacoes];
new Erro[MAX_PLAYERS];
main( ) { }
public OnGameModeInit()
{
UsePlayerPedAnims();
// Don't use these lines if it's a filterscript
SetGameModeText("[M.A.R] RPG - v0.1");
AddPlayerClass(212, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
DOF2_Exit();
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0x33AA33AA, "//-------------------------------------------------------------------------//");
SendClientMessage(playerid, 0x33AA33AA, "Olб, seja bem-vindo ao [M.A.R]Mundo Americano Real!");
SendClientMessage(playerid, 0x33AA33AA, "Precisa de ajuda ? Digite /duvida, relatar um player,\nDigite /Relatorio.");
SendClientMessage(playerid, 0x33AA33AA, "//-------------------------------------------------------------------------//");
}
//===============registro====================//
new arquivo[40], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 32);
format(arquivo, 40, "Contas/%s.ini", name);
if(DOF2_FileExists(arquivo))
{
ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, "Logar", "Vocк й Registrado, digite sua senha para logar!\nSe errar 5 vezes vocк serб kickado!", "Confirma", "Cancelar");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "Registro", "Vocк ainda nгo й Registrado, digite uma senha para se registrar!", "Confirma", "Cancelar");
}
return 1;
}
//===============registro====================//
public OnPlayerDisconnect(playerid, reason)
{
new arquivo[40], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 32);
format(arquivo, 40, "Contas/%s.ini", name);
if(DOF2_FileExists(arquivo))
{
Player[playerid][Dinheiro] = GetPlayerMoney(playerid);
DOF2_SetInt(arquivo, "Senha", Player[playerid][Senha]);
DOF2_SetInt(arquivo, "Matou", Player[playerid][Matou]);
DOF2_SetInt(arquivo, "Morreu", Player[playerid][Morreu]);
DOF2_SetInt(arquivo, "Dinheiro", Player[playerid][Dinheiro]);
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[])
{
return 1;
}
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[])
{
if(dialogid == DIALOG_REGISTRO)
{
if(!strval(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "Registro", "Digite apenas nъmeros!\nDigite sua senha novamente para se registrar!", "Confirma", "Cancelar");
if(!response) return Kick(playerid);
else
{
Player[playerid][Senha] = strval(inputtext);
SalvarContas(playerid);
ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, "Logar", "Vocк se cadastrou, agora й sу logar com sua senha registrada!", "Confirma", "Cancelar");
}
}
if(dialogid == DIALOG_LOGAR)
{
if(!strval(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, "Logar", "Digite apenas nъmeros!\nDigite sua senha cadastrada para logar!\nSe errar 5 vezes vocк serб kickado!", "Confirma", "Cancelar");
if(!response) return Kick(playerid);
else
{
Player[playerid][Senha] = DOF2_GetInt(Contas(playerid), "Senha");
if(strval(inputtext) == Player[playerid][Senha])
{
Player[playerid][Matou] = DOF2_GetInt(Contas(playerid), "Matou");
Player[playerid][Morreu] = DOF2_GetInt(Contas(playerid), "Morreu");
Player[playerid][Dinheiro] = DOF2_GetInt(Contas(playerid), "Dinheiro");
GivePlayerMoney(playerid, Player[playerid][Dinheiro]);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, "Logar", "Vocк digitou sua senha errado, digite-a novamente para logar!\nSe errar 5 vezes vocк serб kickado!", "Confirma", "Cancelar");
Erro[playerid]++;
if(Erro[playerid] == 5)
{
SendClientMessage(playerid, -1, "Vocк foi kickado por errar a senha 5 vezes!");
kick(playerid);
return 1;
}
}
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
Quote:
C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\pa wno\include\DOF2.inc(514) : warning 219: local variable "name" shadows a variable at a preceding level C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(69) : error 021: symbol already defined: "GetPlayerName" C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(71) : error 010: invalid function or declaration C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(75) : error 010: invalid function or declaration C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(79) : error 010: invalid function or declaration C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(85) : warning 219: local variable "arquivo" shadows a variable at a preceding level C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(85) : warning 219: local variable "name" shadows a variable at a preceding level C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(264) : error 017: undefined symbol "SalvarContas" C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(274) : error 017: undefined symbol "Contas" C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(277) : error 017: undefined symbol "Contas" C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(278 ) : error 017: undefined symbol "Contas" C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(279) : error 017: undefined symbol "Contas" C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(289) : error 017: undefined symbol "kick" C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(303) : warning 203: symbol is never used: "arquivo" C:\Users\lucas\Desktop\gta\samp03z_svr_R1_win32\ga memodes\inicial.pwn(303) : warning 203: symbol is never used: "name" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase |