24.09.2010, 00:22
Primeiramente nao so ninguem sei modificar agora to querendo aprender a criar um gm.
com a ajuda de vcs aqui do forum se for possivel.
comeзando:
ate aqui blz mas quando loga o player fica na tela de respawn
ja add a linha AddPlayerClass e as coordenadas mais nao ta indo para o respawn
o q tenho q fazer
agradeзo a ajuda de vcs desde ja!!!
Muito obrigado !!!
tava tentando modificar o vlc de caio_cartaxo mas tem muitos bugs ta osso
vo ver se consigo do inicio
com a ajuda de vcs aqui do forum se for possivel.
comeзando:
pawn Код:
#include <a_samp>
#define GREEN 0x21DD00FF
#define RED 0xE60000FF
#define ADMIN_RED 0xFB0000FF
#define YELLOW 0xFFFF00FF
#define ORANGE 0xF97804FF
#define LIGHTRED 0xFF8080FF
#define LIGHTBLUE 0x00C2ECFF
#define PURPLE 0xB360FDFF
#define PLAYER_COLOR 0xFFFFFFFF
#define BLUE 0x1229FAFF
#define LIGHTGREEN 0x38FF06FF
#define DARKPINK 0xE100E1FF
#define DARKGREEN 0x008040FF
#define ANNOUNCEMENT 0x6AF7E1FF
#define COLOR_SYSTEM 0xEFEFF7AA
#define GREY 0xCECECEFF
#define PINK 0xD52DFFFF
#define DARKGREY 0x626262FF
#define AQUAGREEN 0x03D687FF
#define NICESKY 0x99FFFFAA
#define WHITE 0xFFFFFFFF
//**MISC**//
#define ACCOUNTS_FOLDER "%s.ini"
#define LOGIN_DELAY 3 //
//Variaveis Nao retire//
enum aInfo
{
aSenha[128],
aLogged,
};
enum pInfo
{
pTeam
};
new AccountInfo[MAX_PLAYERS][aInfo];
new registro[MAX_PLAYERS];
new login[MAX_PLAYERS];
new Text:topblack, Text:bottomblack;
new PlayerInfo[MAX_PLAYERS][pInfo];
forward LogIn(playerid);
forward OnPlayerUpdate(playerid);
public OnGameModeInit()
{
topblack = TextDrawCreate(1.000000,-45.000000,"__");
bottomblack = TextDrawCreate(-2.000000,371.000000,"__");
TextDrawUseBox(topblack,1);
TextDrawBoxColor(topblack,0x000000ff);
TextDrawTextSize(topblack,655.000000,80.000000);
TextDrawUseBox(bottomblack,1);
TextDrawBoxColor(bottomblack,0x000000ff);
TextDrawTextSize(bottomblack,840.000000,240.000000);
TextDrawAlignment(topblack,0);
TextDrawAlignment(bottomblack,0);
TextDrawBackgroundColor(topblack,0x000000ff);
TextDrawBackgroundColor(bottomblack,0x000000ff);
TextDrawFont(topblack,3);
TextDrawLetterSize(topblack,1.000000,14.000000);
TextDrawFont(bottomblack,3);
TextDrawLetterSize(bottomblack,1.000000,24.000000);
TextDrawColor(topblack,0xffffffff);
TextDrawColor(bottomblack,0xffffffff);
TextDrawSetOutline(topblack,1);
TextDrawSetOutline(bottomblack,1);
TextDrawSetProportional(topblack,1);
TextDrawSetProportional(bottomblack,1);
TextDrawSetShadow(topblack,1);
TextDrawSetShadow(bottomblack,1);
SetGameModeText("EPF: V1.0");
SendRconCommand("mapname Brasil: RPG");
{
AddPlayerClass(288,1128.8350,-1489.8019,22.7690,181.2477,0,0,0,0,0,0);
}
return 1;
}
public OnGameModeExit()
{
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)
{
PlayerInfo[playerid][pTeam] = 3;
TextDrawShowForPlayer(playerid, topblack);
TextDrawShowForPlayer(playerid, bottomblack);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new string[128];
format(string, sizeof(string), ACCOUNTS_FOLDER, name);
if (AccountInfo[playerid][aLogged] == 0)
{
if (!fexist(string))
{
new kayitmsg[256];
format(kayitmsg,256,"Bem Vindo ao ExTrEmE PlAy FoReVeR\nDigite sua Senha para Registrar!!!\n\nRegistre-se usando Nome_Sobrenome",name);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrar",kayitmsg,"Registrar","Sair");
registro[playerid] = 1;
login[playerid] = 0;
}
else if (fexist(string))
{
new girismsg[256];
format(girismsg,256,"Bem Vindo ao ExTrEmE PlAy FoReVeR\nDigite sua Senha para Logar!!!\n\nLogue-se usando Nome_Sobrenome\nSe errar a senha 5 vezes serб banido por serguranзa",name);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Logar",girismsg,"Logar","Sair");
registro[playerid] = 0;
login[playerid] = 1;
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
OnPlayerUpdate(playerid);
AccountInfo[playerid][aLogged] = 0;
registro[playerid] = 0;
login[playerid] = 0;
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;
}
stock ini_GetKey( line[] )
{
new keyRes[256];
keyRes[0] = 0;
if ( strfind( line , "=" , true ) == -1 ) return keyRes;
strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
return keyRes;
}
stock ini_GetValue( line[] )
{
new valRes[256];
valRes[0]=0;
if ( strfind( line , "=" , true ) == -1 ) return valRes;
strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
return valRes;
}
public LogIn(playerid)
{
AccountInfo[playerid][aLogged] = 1;
registro[playerid] = 0;
login[playerid] = 0;
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)
{
if(IsPlayerConnected(playerid))
{
if(AccountInfo[playerid][aLogged] == 1)
{
new string3[128];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
new ip[20];
GetPlayerIp(playerid,ip,sizeof(ip));
new File: hFile = fopen(string3, io_write);
if (hFile)
{
new var[128];
format(var, 128, "Senha=%s\n", AccountInfo[playerid][aSenha]);fwrite(hFile, var);
format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
fclose(hFile);
}
}
}
return 1;
}
Encrypt(string[])
{
for(new x=0; x < strlen(string); x++)
{
string[x] += (3^x) * (x % 15);
if(string[x] > (0xff))
{
string[x] -= 256;
}
}
}
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 (response == 1)
{
if(dialogid == 12345)
{
if(strlen(inputtext))
{
Encrypt(inputtext);
new player[MAX_PLAYER_NAME];
GetPlayerName(playerid, player, 50);
new string3[32];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
new ip[20];
GetPlayerIp(playerid,ip,sizeof(ip));
new File: hFile = fopen(string3, io_write);
if (hFile)
{
strmid(AccountInfo[playerid][aSenha], inputtext, 0, strlen(inputtext), 255);
new var[128];
format(var, 128, "Senha=%s\n", AccountInfo[playerid][aSenha]);fwrite(hFile, var);
format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
fclose(hFile);
printf("%s is signed up.",playername3);
SendClientMessage(playerid, GREEN, "|- Voce jб esta registrado,faзa o login. -|");
new girismsg[256];
format(girismsg,256,"Bem Vindo ao ExTrEmE PlAy FoReVeR\nDigite sua Senha para Logar!!!\n\nLogue-se usando Nome_Sobrenome\nSe errar a senha 5 vezes serб banido por serguranзa",playername3);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
registro[playerid] = 0;
login[playerid] = 1;
}
}
else if(!strlen(inputtext))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new kayitmsg[256];
format(kayitmsg,256,"Bem Vindo ao ExTrEmE PlAy FoReVeR\nDigite sua Senha para Registrar!!!\n\nRegistre-se usando Nome_Sobrenome",name);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrar",kayitmsg,"Registrar","Sair");
registro[playerid] = 1;
login[playerid] = 0;
}
}
if(dialogid == 12346)
{
Encrypt(inputtext);
new string2[128];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
new PassData[256];
new keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Senha" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(AccountInfo[playerid][aSenha], valtmp, 0, strlen(valtmp)-1, 255);
}
if(strcmp(AccountInfo[playerid][aSenha],inputtext, true ) == 0)
{
if(strlen(inputtext))
{
for(new p = 0; p < strlen(AccountInfo[playerid][aSenha]); p++)
{
inputtext[p] = '?';
}
SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid);
printf("%s esta logando.",playername2);
new key[256];
new Data[256];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
/*if(strcmp(key, "AdminLevel", true) == 0) // This is only an example if you want to add more stuff to store in a file.
{
val = ini_GetValue( Data );
AccountInfo[playerid][AdminLevel] = strval(val); // Uncommenting this will give you errors if the variable isn't defined.
}
*/
}
fclose(UserFile);
}
}
else
{
if(strlen(inputtext))
{
new girismsg[256];
printf("%s esta usando senha errada.",playername2);
format(girismsg,256,"Senha errada! - Se errar a senha 5 veses й BAN");
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
login[playerid] = 1;
registro[playerid] = 0;
fclose(UserFile);
return 1;
}
}
if(!strlen(inputtext))
{
new girismsg[256];
printf("%s nao esta entrando com senha.",playername2);
format(girismsg,256,"Senha errada! - Se errar a senha 5 veses й BAN");
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
login[playerid] = 1;
registro[playerid] = 0;
fclose(UserFile);
return 1;
}
}
}
if(dialogid == 12347)
{
Encrypt(inputtext);
new string2[128];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
new PassData[256];
new keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Senha" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(AccountInfo[playerid][aSenha], valtmp, 0, strlen(valtmp)-1, 255);
}
if(strcmp(AccountInfo[playerid][aSenha],inputtext, true ) == 0)
{
if(strlen(inputtext))
{
for(new p = 0; p < strlen(AccountInfo[playerid][aSenha]); p++)
{
inputtext[p] = '?';
}
SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid);
printf("%s esta logando.",playername2);
new key[256];
new Data[256];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
/*if(strcmp(key, "AdminLevel", true) == 0) // Este й apenas um exemplo, se vocк quiser acrescentar mais coisas para guardar em um arquivo.
{
val = ini_GetValue( Data );
AccountInfo[playerid][AdminLevel] = strval(val); // Descomentando isso vai lhe dar erros se a variбvel nгo estб definida.
}
*/
}
fclose(UserFile);
}
}
else
{
if(strlen(inputtext))
{
new girismsg[256];
printf("%s esta errando a senha.",playername2);
format(girismsg,256,"Senha errada! - Se errar a senha 5 veses й BAN");
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
login[playerid] = 1;
registro[playerid] = 0;
fclose(UserFile);
return 1;
}
}
if(!strlen(inputtext))
{
new girismsg[256];
printf("%s nao esta entrando com senha.",playername2);
format(girismsg,256,"Senha errada! - Se errar a senha 5 veses й BAN");
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
login[playerid] = 1;
registro[playerid] = 0;
fclose(UserFile);
return 1;
}
}
}
}
else return Kick(playerid);
return 0;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
ja add a linha AddPlayerClass e as coordenadas mais nao ta indo para o respawn
o q tenho q fazer
agradeзo a ajuda de vcs desde ja!!!
Muito obrigado !!!
tava tentando modificar o vlc de caio_cartaxo mas tem muitos bugs ta osso
vo ver se consigo do inicio