Una dudita ...
#1

Hola menes como tan .....

1) Bueno mi problema es el siguiente ....

Cree un sistema de registro con uno de los tutoriales de aki del foro .....

Y bueno ise todo como decia el post copile el fs y todo bn .... lo agrege al server ...

Pero cuando entro no me sale el sistema de registro es como si no lo uviese puesto al server ....

Porfavor ayuda .....

2) Bueno mi segunda duda es la siguiente como ago que la gente mi server sea por grupos osea sibiles contra Policias .....

Que cuando salga para escojer los personajes si escojes un poli aparescas en base poli ... y si escojes un sibil aparesca noce en otro lado ps ....

Bueno es todo menes .... espero me puedan ayudaar ...

Saludoss ... !!
Reply
#2

1)agrega parte del codigo aun que sea para que podamos ver en que te has equivocado
2)puedes hacer algo asi:
pawn Код:
//debajo de los includes:
#define POLICIA 1
#define CIVIL 2

new gTeam[MAX_PLAYERS]];
pawn Код:
public OnGameModeInit()
{
  //aqui agregas todos los skin que tu quieras que se puedan seleccionar.
  return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
  switch(classid){
    case 0, 1, 2, 3, 4, 5:{//reemplaza los numeros por los skin de los policias
      gTeam[playerid] = POLICIA;
      GameTextForPlayer(playerid, "~W~Eres un ~B~Policia", 2000, 0);
    }
    else{
      gTeam[playerid] = CIVIL;
      GameTextForPlayer(playerid, "~W~Eres un ~R~Civil", 2000, 0);
    }
  }
  return 1;
}

public OnPlayerSpawn(playerid)
{
  if(gTeam[playerid] == POLICIA)return SetPlayerColor(playerid, 0x0000FFFF);
  return SetPlayerColor(playerid, 0xFF0000FF);
}
Espero que te sirva.

Si no tambien puedes mirar este TUTORIAL

Reply
#3

Quote:
Originally Posted by the_chaoz
Si no tambien puedes mirar este TUTORIAL
Gracias, al menos alguien se fija

Y dani23843 mejor buscas antes porque es mбs fбcil, y los que ponemos tutoriales no pensamos en vano, esperamos a que alguien acuda a esa ayuda
Reply
#4

Hola menes si graciaass .....

Bueno les voy a poner el fs que ise para que vean si tiene errores ....

Код:
#include <a_samp>
#include <dini>
#include <dudb>

#define COLOR_VERDE 0x00AF00FF

new IsLogged[MAX_PLAYERS];
new IsRegistered[MAX_PLAYERS];

enum pInfo
{
	pAdmin,
	pKills,
	pDeaths,
	pLogins
}

new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
	IsLogged[playerid] = 0;
	IsRegistered[playerid] = 0;

	new Nombre[MAX_PLAYERS];
	new file[MAX_PLAYERS];
	GetPlayerName(playerid, Nombre, sizeof(Nombre));
	format(file, sizeof(file), "%s.ini", Nombre);

	if(fexist(file)) { IsRegistered[playerid] = 1; }

	if(IsRegistered[playerid] == 0)
	{
	SendClientMessage(playerid, 0xFFFFFFFF, "Cuenta sin registrar, por favor registrate: /Registrar [Contraseсa]");
	}
	else
	{
	SendClientMessage(playerid, 0xFFFFFFFF, "Cuenta registrada, por favor identificate: /Sesion [Contraseсa]");
	}
	return 1;
}

public OnPlayerDisconnect(playerid)
{
	new Nombre[MAX_PLAYERS];
	new file[MAX_PLAYERS];
	GetPlayerName(playerid, Nombre, sizeof(Nombre));
	format(file, sizeof(file), "%s.ini", Nombre);

	if(IsLogged[playerid] == 1)
	{
	dini_IntSet(file, "Admin", PlayerInfo[playerid][pAdmin]);
	dini_IntSet(file, "Kills", PlayerInfo[playerid][pKills]);
	dini_IntSet(file, "Deaths", PlayerInfo[playerid][pDeaths]);
	dini_IntSet(file, "Logins", PlayerInfo[playerid][pLogins]);
	}
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	PlayerInfo[playerid][pDeaths] ++;
	PlayerInfo[killerid][pKills] ++;
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);

	if(strcmp(cmd, "/Registrar", true) == 0)
	{
		new tmp[256];
		new Nombre[MAX_PLAYERS];
		new String[100];
		new file[MAX_PLAYERS];
		GetPlayerName(playerid, Nombre, sizeof(Nombre));
		tmp = strtok(cmdtext, idx);
		format(file, sizeof(file), "%s.ini", Nombre);

		if(!strlen(tmp))
		{
			SendClientMessage(playerid, 0xFFFFFFFF, "Use: /Registrar [Contraseсa]");
			return 1;
		}

		if(!fexist(file))
		{
			dini_Create(file);
			dini_IntSet(file, "Password", udb_hash(tmp));
			dini_IntSet(file, "Admin", 0);
			dini_IntSet(file, "Kills", 0);
			dini_IntSet(file, "Deaths", 0);
			dini_IntSet(file, "Logins", 1);
			PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
			PlayerInfo[playerid][pKills] = dini_Int(file, "Kills");
			PlayerInfo[playerid][pDeaths] = dini_Int(file, "Deaths");
			PlayerInfo[playerid][pLogins] = dini_Int(file, "Logins");
			format(String, sizeof(file), "Cuenta creada exitosamente! %s - ''%s''", Nombre, tmp);
			SendClientMessage(playerid, 0xFFFFFFFF, String);
			SendClientMessage(playerid, 0xFFFFFFFF, "Has sido identificado automбticamente");
			IsLogged[playerid] = 1;
		}
		else
		{
			SendClientMessage(playerid, 0xFFFFFFFF, "Error: La cuenta ya estб registrada");
		}

		return 1;
	}


	if(strcmp(cmd, "/Sesion", true) == 0)
	{
		new tmp[256];
		new tmp2[256];
		new Nombre[MAX_PLAYERS];
		new file[MAX_PLAYERS];
		GetPlayerName(playerid, Nombre, sizeof(Nombre));
		format(file, sizeof(file), "%s.ini", Nombre);
		tmp = strtok(cmdtext, idx);
		tmp2 = dini_Get(file, "Password");

		if(!strlen(tmp))
		{
			SendClientMessage(playerid, 0xFFFFFFFF, "Use: /Sesion [Contraseсa]");
			return 1;
		}

		if(IsLogged[playerid] == 1)
		{
			SendClientMessage(playerid, COLOR_VERDE, "Tъ ya estбs identificado!");
			return 1;
		}
		else
		{
		if(fexist(file))
		{
			if(udb_hash(tmp) == strval(tmp2))
			{
				IsLogged[playerid] = 1;
				PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
				PlayerInfo[playerid][pKills] = dini_Int(file, "Kills");
				PlayerInfo[playerid][pDeaths] = dini_Int(file, "Deaths");
				PlayerInfo[playerid][pLogins] = dini_Int(file, "Logins");
				PlayerInfo[playerid][pLogins] ++;
				SendClientMessage(playerid, COLOR_VERDE, "Te has identificado exitosamente.");
			}
		}
		}
		return 1;
	}


	if (strcmp("/Cuenta", cmdtext, true, 10) == 0)
	{
		new Nombre[MAX_PLAYERS];
		new String[100];
		GetPlayerName(playerid, Nombre, sizeof(Nombre));

		format(String, sizeof(String), "%s Estadisticas:", Nombre);
		SendClientMessage(playerid, 0xFFFFFFFF, String);
		format(String, sizeof(String), "Asesinatos: %d - Muertes: %d - Radio: %0.2f - Logins: %d", PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], Float:PlayerInfo[playerid][pKills]/PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pLogins]);
		SendClientMessage(playerid, 0xFFFFFFFF, String);
		return 1;
	}

	return 0;
}
Hola bueno espero vean el fs y me digas si ta maal .....

Y bueno el fs se copila y todo pero no funciona ....

Saludooss ..
Reply
#5

esto no va como un fs, va como un GM xD
Reply
#6

Quote:
Originally Posted by the_chaoz
esto no va como un fs, va como un GM xD
yo lo hise como FS
Y SI ME FUNCIONO xd
Reply
#7

es que se supone que va como un GM de TDM, pero buen xD
Reply
#8

Hola si gracias entoces mejor lo agrego al GM ....

Pero al copilar me lansa los siguiente errores ....

Код:
C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dutils.inc(298) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dutils.inc(462) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dini.inc(46) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dini.inc(54) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(45) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(148) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(188) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(191) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(192) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(196) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(198) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(202) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(206) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(218) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(219) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(223) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(230) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(357) : error 021: symbol already defined: "cmd"
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(358) : error 021: symbol already defined: "idx"
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(363) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(364) : error 001: expected token: "-identifier-", but found "["
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(366) : error 001: expected token: "-identifier-", but found "["
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 001: expected token: ")", but found "sizeof"
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


20 Errors.
Bueno si me pueden ayudar con los errores ... porfavor respondan aki DDD
Reply
#9

empeza fijandote que estoy casi seguro que definiste dos veces la viariable "tmp". y depues si siguen saliendo errores, por favor pone aun que sea las lineas de errores asi resulta mas facil ayudarte
Reply
#10

hola men ahora me salen estos....

C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dutils.inc(29 : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dutils.inc(462) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dini.inc(46) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dini.inc(54) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(45) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(14 : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(18 : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(191) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(192) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(196) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(19 : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(202) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(206) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(21 : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(219) : error 020: invalid symbol name ""
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(223) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(230) : error 010: invalid function or declaration
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(366) : error 001: expected token: "-identifier-", but found "["
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 001: expected token: ")", but found "sizeof"
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


17 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)