Ayuda, Poner Textdraw En sistema de Clanes
#1

Hola, quisiera ponerle un Textdraw a este sistema de clanes creado por Parka
Ayuda Por Favor, Sera un textdraw abajo y que diga el clan que poseas


Quote:

/*
© Copyright 2014 by Parka

Sistema de Clanes

Inicio: 01/09/2014 - 04:24 p.m.(GTM-4)
Fin: 01/09/2014 - 06:54 p.m.(GTM-4)
Ultima Actualizacion: 03/09/2014 - 12:45 p.m.(GTM-4)

Version: 0.2

CLANES_MAXIMOS: El maximo de clanes que se pueden crear(Cambiarlo si es necesario).
ZONA_LONGITUD: El tamaГ±o de las zonas(Cambiarlo si es necesario).
MAX_ZONAS: El maximo de zonas que se pueden conquistar(Cambiarlo si es necesario).
MAX_MIEMBROS_CONQUISTA: El maximo de miembros requeridos para conquistar la zona(Cambiarlo si es necesario).
MAX_TIEMPO_CONQUISTA: El tiempo que debe estar en la zona para conquistarla(En segundos)(Cambiarlo si es necesario).
*/
//Libreria Default de SA-MP(By SA-MP TEAM)
#include <a_samp>
//Procesador de comandos(By Zeex).
#include <zcmd>
//Estractor de datos(By ******).
#include <sscanf2>
//Guardado de datos por achivos(By DracoBlue).
#include <Dini>
//Direccion donde se guardaran los jugadores(Datos).
#define Jugadores "/alianza/jugadores/%s.ini"
//Direccion donde se guardaran los Clanes(Datos).
#define Alianza "/alianza/clanes.cfg"
//Maxima cantidad de clanes que pueden ser registrados en el servidor.
#define CLANES_MAXIMOS (50)
//Maxima cantidad de zonas que pueden ser conquistadas en el servidor.
#define MAX_ZONAS (20)
//El tamaГ±o de las Zonas.
#define ZONA_LONGITUD (100.0)
//la cantidad de miembros a conquista la zona.
#define MAX_MIEMBROS_CONQUISTA (1)
//Tiempo que deben estar en la zona para conquistarla(en segundos).
#define MAX_TIEMPO_CONQUISTA (10)
//macro, color, gris.
#define Error 0xC0C0C0FF
//macro, color, MediumSpringGreen.
#define ChatColor 0x00FA9AFF
//macro, color, naranja.
#define Naranja 0xFFA500FF
//macro, color, amarillo.
#define Amarillo 0xFFFF00FF
//Macro, dialog, definir ID(Crear Clan).
#define Dialog_Crear_Clan (1333)
#define Dialog_Infor_Clan (1334)
//Colores By SA-MP TEAM
new ColoursTableRGBA[256]={
// The existing colours from San Andreas
0x00000044, 0xF5F5F5FF, 0x2A77A1FF, 0x840410FF, 0x263739FF, 0x86446EFF, 0xD78E10FF, 0x4C75B7FF, 0xBDBEC6FF, 0x5E7072FF,
0x46597AFF, 0x656A79FF, 0x5D7E8DFF, 0x58595AFF, 0xD6DAD6FF, 0x9CA1A3FF, 0x335F3FFF, 0x730E1AFF, 0x7B0A2AFF, 0x9F9D94FF,
0x3B4E78FF, 0x732E3EFF, 0x691E3BFF, 0x96918CFF, 0x515459FF, 0x3F3E45FF, 0xA5A9A7FF, 0x635C5AFF, 0x3D4A68FF, 0x979592FF,
0x421F21FF, 0x5F272BFF, 0x8494ABFF, 0x767B7CFF, 0x646464FF, 0x5A5752FF, 0x252527FF, 0x2D3A35FF, 0x93A396FF, 0x6D7A88FF,
0x221918FF, 0x6F675FFF, 0x7C1C2AFF, 0x5F0A15FF, 0x193826FF, 0x5D1B20FF, 0x9D9872FF, 0x7A7560FF, 0x989586FF, 0xADB0B0FF,
0x848988FF, 0x304F45FF, 0x4D6268FF, 0x162248FF, 0x272F4BFF, 0x7D6256FF, 0x9EA4ABFF, 0x9C8D71FF, 0x6D1822FF, 0x4E6881FF,
0x9C9C98FF, 0x917347FF, 0x661C26FF, 0x949D9FFF, 0xA4A7A5FF, 0x8E8C46FF, 0x341A1EFF, 0x6A7A8CFF, 0xAAAD8EFF, 0xAB988FFF,
0x851F2EFF, 0x6F8297FF, 0x585853FF, 0x9AA790FF, 0x601A23FF, 0x20202CFF, 0xA4A096FF, 0xAA9D84FF, 0x78222BFF, 0x0E316DFF,
0x722A3FFF, 0x7B715EFF, 0x741D28FF, 0x1E2E32FF, 0x4D322FFF, 0x7C1B44FF, 0x2E5B20FF, 0x395A83FF, 0x6D2837FF, 0xA7A28FFF,
0xAFB1B1FF, 0x364155FF, 0x6D6C6EFF, 0x0F6A89FF, 0x204B6BFF, 0x2B3E57FF, 0x9B9F9DFF, 0x6C8495FF, 0x4D8495FF, 0xAE9B7FFF,
0x406C8FFF, 0x1F253BFF, 0xAB9276FF, 0x134573FF, 0x96816CFF, 0x64686AFF, 0x105082FF, 0xA19983FF, 0x385694FF, 0x525661FF,
0x7F6956FF, 0x8C929AFF, 0x596E87FF, 0x473532FF, 0x44624FFF, 0x730A27FF, 0x223457FF, 0x640D1BFF, 0xA3ADC6FF, 0x695853FF,
0x9B8B80FF, 0x620B1CFF, 0x5B5D5EFF, 0x624428FF, 0x731827FF, 0x1B376DFF, 0xEC6AAEFF, 0x000000FF,
// SA-MP extended colours (0.3x)
0x177517FF, 0x210606FF, 0x125478FF, 0x452A0DFF, 0x571E1EFF, 0x010701FF, 0x25225AFF, 0x2C89AAFF, 0x8A4DBDFF, 0x35963AFF,
0xB7B7B7FF, 0x464C8DFF, 0x84888CFF, 0x817867FF, 0x817A26FF, 0x6A506FFF, 0x583E6FFF, 0x8CB972FF, 0x824F78FF, 0x6D276AFF,
0x1E1D13FF, 0x1E1306FF, 0x1F2518FF, 0x2C4531FF, 0x1E4C99FF, 0x2E5F43FF, 0x1E9948FF, 0x1E9999FF, 0x999976FF, 0x7C8499FF,
0x992E1EFF, 0x2C1E08FF, 0x142407FF, 0x993E4DFF, 0x1E4C99FF, 0x198181FF, 0x1A292AFF, 0x16616FFF, 0x1B6687FF, 0x6C3F99FF,
0x481A0EFF, 0x7A7399FF, 0x746D99FF, 0x53387EFF, 0x222407FF, 0x3E190CFF, 0x46210EFF, 0x991E1EFF, 0x8D4C8DFF, 0x805B80FF,
0x7B3E7EFF, 0x3C1737FF, 0x733517FF, 0x781818FF, 0x83341AFF, 0x8E2F1CFF, 0x7E3E53FF, 0x7C6D7CFF, 0x020C02FF, 0x072407FF,
0x163012FF, 0x16301BFF, 0x642B4FFF, 0x368452FF, 0x999590FF, 0x818D96FF, 0x99991EFF, 0x7F994CFF, 0x839292FF, 0x788222FF,
0x2B3C99FF, 0x3A3A0BFF, 0x8A794EFF, 0x0E1F49FF, 0x15371CFF, 0x15273AFF, 0x375775FF, 0x060820FF, 0x071326FF, 0x20394BFF,
0x2C5089FF, 0x15426CFF, 0x103250FF, 0x241663FF, 0x692015FF, 0x8C8D94FF, 0x516013FF, 0x090F02FF, 0x8C573AFF, 0x52888EFF,
0x995C52FF, 0x99581EFF, 0x993A63FF, 0x998F4EFF, 0x99311EFF, 0x0D1842FF, 0x521E1EFF, 0x42420DFF, 0x4C991EFF, 0x082A1DFF,
0x96821DFF, 0x197F19FF, 0x3B141FFF, 0x745217FF, 0x893F8DFF, 0x7E1A6CFF, 0x0B370BFF, 0x27450DFF, 0x071F24FF, 0x784573FF,
0x8A653AFF, 0x732617FF, 0x319490FF, 0x56941DFF, 0x59163DFF, 0x1B8A2FFF, 0x38160BFF, 0x041804FF, 0x355D8EFF, 0x2E3F5BFF,
0x561A28FF, 0x4E0E27FF, 0x706C67FF, 0x3B3E42FF, 0x2E2D33FF, 0x7B7E7DFF, 0x4A4442FF, 0x28344EFF
};
//Enum de la variable Clanes.
enum eAlianza{
aSlot,
aNombre[32],//Almacena el nombre de la alianza
aLider[24],//Almacena el nombre del lider de la alianza
aKills,//Almacena la cantidad de Kills(de todos los miembros de la alianza).
aDeaths,//Almacena la cantidad de Deaths(de todos los miembros de la alianza).
aConquista,//Almacena el nombre de la alianza
aColor//Almacena el ID del color.
}
//Clanes(variable), almacenar datos de todos los clanes.
new Clanes[CLANES_MAXIMOS][eAlianza];
//Enum de la variable
enum zConsquitables{
Float:zPos[3],
zClan,
zGang
}
new ZoneTakeOverTeam[MAX_ZONAS];
new ZoneTakeOverTime[MAX_ZONAS];
//Array Almacena la posicion de las zonas conquistables.
new Zonas[MAX_ZONAS][zConsquitables] = {
{{2637.2712,1129.2743,11.1797},0},
{{2000.0106,1521.1111,17.0625},0},
{{2024.8190,1917.9425,12.3386},0},
{{2261.9048,2035.9547,10.8203},0},
{{2262.0986,2398.6572,10.8203},0},
{{2244.2566,2523.7280,10.8203},0},
{{2335.3228,2786.4478,10.8203},0},
{{2150.0186,2734.2297,11.1763},0},
{{2158.0811,2797.5488,10.8203},0},
{{1969.8301,2722.8564,10.8203},0},
{{1652.0555,2709.4072,10.8265},0},
{{1564.0052,2756.9463,10.8203},0},
{{1271.5452,2554.0227,10.8203},0},
{{1441.5894,2567.9099,10.8203},0},
{{1480.6473,2213.5718,11.0234},0},
{{1400.5906,2225.6960,11.0234},0},
{{1676.204,-1954.256,1820.712},0},
{{2448.18,-1705.548,2490.011},0},
{{1124.793,-2096.375,1246.484},0},//19
{{-2132.02,144.3358,-2004.552},0}
};
//Enum de la variable Usuario.
enum eUsuario{
uLider,
uMiembro
}
//Usuario(variable), almacenar datos de todos los jugadores.
new Usuario[MAX_PLAYERS][eUsuario];
//Prevenir futuros Bugs.
new PuedeGuardarse = true;
//Obtener directamente el nombre del jugador.
static dbNombre(playerid){
new nombre[MAX_PLAYER_NAME];
GetPlayerName(playerid,nombre,sizeof(nombre));
return nombre;
}
//Obtener directamente la ubicacion del archivo(Jugadores).
static dbJugadores(playerid){
new str[64];
format(str,sizeof(str),Jugadores,dbNombre(playerid ));
return str;
}
//Llamada al momento de iniciar el servidor
public OnFilterScriptInit(){
print("Sistema de clanes: Cargado");
CargarClanes();
SetTimer("ActualizarZonas",1000,true);
for(new z=0;z<sizeof(Zonas);z++){//Bucle, Zonas.
Zonas[z][zGang] = GangZoneCreate(Zonas[z][zPos][0] - ZONA_LONGITUD,Zonas[z][zPos][1] - ZONA_LONGITUD,Zonas[z][zPos][0] + ZONA_LONGITUD,Zonas[z][zPos][1] + ZONA_LONGITUD);//Crear la GanZone.
ZoneTakeOverTeam[z] = -1;
}
}
//Llamada al momento que un jugador entra al juego.
public OnPlayerConnect(playerid){
switch(dini_Exists(dbJugadores(playerid))){
case true:{//Si existe, devolverle los valores a ambas variables.
Usuario[playerid][uLider] = dini_Int(dbJugadores(playerid),"lider");//Obtener valor de lider.
Usuario[playerid][uMiembro] = dini_Int(dbJugadores(playerid),"miembro");//Obtener valor de miembro.
}
case false:{//De lo contrario, crear el archivo.
dini_Create(dbJugadores(playerid));//Crea el archivo.
Usuario[playerid][uLider] = 0;//Setea a variable a 0
Usuario[playerid][uMiembro] = 0;//Setea a variable a 0
}
}
for(new z=0;z<sizeof(Zonas);z++){
GangZoneShowForPlayer(playerid,Zonas[z][zGang],ColoursTableRGBA[Clanes[Zonas[z][zClan]][aColor]]);//Muestra la Zona conquistable.
if(ZoneTakeOverTeam[z] != -1){//Si la zona esta siendo atacada parpadeara.
GangZoneFlashForPlayer(playerid,Zonas[z][zGang],ColoursTableRGBA[Clanes[ZoneTakeOverTeam[z]][aColor]]);
}
}
return 1;
}
//Llamada al momento que un jugador sale del juego.
public OnPlayerDisconnect(playerid,reason){
switch(dini_Exists(dbJugadores(playerid))){
case true:{//Si existe, devolverle los valores a ambas variables.
dini_IntSet(dbJugadores(playerid),"lider",Usuario[playerid][uLider]);//Guardar valores en el archivo(Usuario).
dini_IntSet(dbJugadores(playerid),"miembro",Usuari o[playerid][uMiembro]);//Guardar valores en el archivo(Usuario).
}
}

if(PuedeGuardarse){
PuedeGuardarse = false;
GuardarClanes();
SetTimer("RetornarTrue",1000,false);
}
return 1;
}
//Llamada cuando un jugador Spawnea.
public OnPlayerSpawn(playerid){
if(Usuario[playerid][uMiembro] != 0){
SetPlayerColor(playerid,ColoursTableRGBA[Clanes[Usuario[playerid][uMiembro]][aColor]]);
}else SetPlayerColor(playerid,0xFFFFFFFF);
return 1;
}
//Llamada cuando un juegador asesina a otro, o el jugador muere.
public OnPlayerDeath(playerid,killerid,reason){
if(killerid != INVALID_PLAYER_ID){//Verificar que un jugador mato a otro.
new cAsesino = Usuario[killerid][uMiembro];//Id del clan del jugador que mata.
new cMuerto = Usuario[playerid][uMiembro];//Id del clan del jugador que muere.
if(cMuerto != 0 && cAsesino != 0){//Si ambos tienen alianza.
Clanes[cAsesino][aKills]++;//Sumarle +1 kill al clan del jugador que mato.
Clanes[cMuerto][aDeaths]++;//Sumarle +1 death al clan del jugador que murio.
}else if(cAsesino != 0){//Si solo el asesino la tiene.
Clanes[cAsesino][aKills]++;//Sumarle +1 kill al clan del jugador que mato.
}else if(cMuerto != 0){//Si solo el muerto la tiene.
Clanes[cMuerto][aDeaths]++;//Sumarle +1 death al clan del jugador que murio.
}
}
return 1;
}
//Comando para crear el clan.
COMMAND:crearclan(playerid,params[]){
//Comprobar que el usuario no tenga clan.
if(!Usuario[playerid][uMiembro]){
//Mostrar dialogo al jugador(para la creacion de clan).
ShowPlayerDialog(playerid,Dialog_Crear_Clan,DIALOG _STYLE_INPUT,"{ffffff}[!]Nombre del clan:","{ffffff}Escribe en el siguiente \n{ffffff}espacio el nombre del clan:","Aceptar","Cancelar");
}else return SendClientMessage(playerid,Error,"Error: Usted ya pertenece a una clan.");
return 1;
}
//Observar todos los comandos del clan.
COMMAND:claninfo(playerid,params[]){
SendClientMessage(playerid,Naranja,"Comandos para los clanes:");
SendClientMessage(playerid,Naranja,"/clan = informacion del clan.");
SendClientMessage(playerid,Naranja,"/t = Chat de la alianza.");
SendClientMessage(playerid,Naranja,"/miembros = lista de miembros conectados.");
SendClientMessage(playerid,Naranja,"/color = Asignarle un color al clan(Lider).");
SendClientMessage(playerid,Naranja,"/reclutar = invitar a un jugador al clan(Lider).");
SendClientMessage(playerid,Naranja,"/expulsar = hechar a un jugador al clan(Lider).");
return 1;
}
//Comando para Expulsar personas(Solo lider).
COMMAND:expulsar(playerid,params[]){
new user, string[144];
if(!Usuario[playerid][uMiembro]) return SendClientMessage(playerid,Error,"Usted no pertenece a un clan.");
if(!Usuario[playerid][uLider]) return SendClientMessage(playerid,Error,"Usted no es lider de clan.");
if(sscanf(params,"u",user)) return SendClientMessage(playerid,Error,"Error: /Expulsar [ID - Nombre]");
if(Usuario[user][uMiembro] == Usuario[playerid][uMiembro]){
Usuario[user][uMiembro] = 0;
format(string,sizeof(string),"Usted expulso a %s al clan.",dbNombre(user));
SendClientMessage(playerid,Amarillo,string);
format(string,sizeof(string),"%s te expulso de su clan.",dbNombre(playerid));
SendClientMessage(user,Amarillo,string);
}else SendClientMessage(playerid,Error,"Este jugador no pertenece a tu clan.");
return 1;
}
//Comando para reclutar personas(Solo lider).
COMMAND:reclutar(playerid,params[]){
new user, string[144];
if(!Usuario[playerid][uMiembro]) return SendClientMessage(playerid,Error,"Usted no pertenece a un clan.");
if(!Usuario[playerid][uLider]) return SendClientMessage(playerid,Error,"Usted no es lider de clan.");
if(sscanf(params,"u",user)) return SendClientMessage(playerid,Error,"Error: /Reclutar [ID - Nombre]");
if(!Usuario[user][uMiembro]){
Usuario[user][uMiembro] = Usuario[playerid][uMiembro];
format(string,sizeof(string),"Usted recluto a %s al clan.",dbNombre(user));
SendClientMessage(playerid,Amarillo,string);
format(string,sizeof(string),"%s te recluto a su clan.",dbNombre(playerid));
SendClientMessage(user,Amarillo,string);
}else SendClientMessage(playerid,Error,"Este jugador pertenece a un clan.");
return 1;
}
//Comando para darle color al clan(Solo lider).
COMMAND:color(playerid,params[]){
new item, clanid=Usuario[playerid][uMiembro];
if(!clanid) return SendClientMessage(playerid,Error,"Usted no pertenece a un clan.");
if(!Usuario[playerid][uLider]) return SendClientMessage(playerid,Error,"Usted no es lider de clan.");
if(sscanf(params,"d",item)) return SendClientMessage(playerid,Error,"Error: /Color [0 - 255]");
switch(item){
case 0 .. 255:{
Clanes[Usuario[playerid][uMiembro]][aColor] = item;
SendClientMessage(playerid,ColoursTableRGBA[Clanes[Usuario[playerid][uMiembro]][aColor]],"El color de su clan ha cambiado.");
}
default: SendClientMessage(playerid,Error,"Error: /Color [0 - 255]");
}
return 1;
}
//Comando para la informacion del clan.
COMMAND:clan(playerid,params[]){
new string[64], clanid=Usuario[playerid][uMiembro];
if(!clanid) return SendClientMessage(playerid,Error,"Usted no pertenece a un clan.");
format(string,sizeof(string),"%s",Clanes[clanid][aNombre]);
SendClientMessage(playerid,Amarillo,string);
format(string,sizeof(string),"Lider: %s",Clanes[clanid][aLider]);
SendClientMessage(playerid,Amarillo,string);
format(string,sizeof(string),"Kills Total: %d - Deaths Total: %d",Clanes[clanid][aKills],Clanes[clanid][aDeaths]);
SendClientMessage(playerid,Amarillo,string);
format(string,sizeof(string),"Conquistas Total: %d",Clanes[clanid][aConquista]);
SendClientMessage(playerid,Amarillo,string);
format(string,sizeof(string),"Ratio: %.2f",float(Clanes[clanid][aKills])/float(Clanes[clanid][aDeaths]));
SendClientMessage(playerid,Amarillo,string);
return 1;
}
//Comando para chat con miembros del clan.
COMMAND:t(playerid,params[]){
new sms[90], string[144], clanid=Usuario[playerid][uMiembro];
if(!clanid) return SendClientMessage(playerid,Error,"Usted no pertenece a un clan.");
if(sscanf(params,"s[90]",sms)) return SendClientMessage(playerid,Error,"Error: /t [Mensaje]");
for(new miembro=0;miembro<MAX_PLAYERS;miembro++){
if(Usuario[miembro][uMiembro] == clanid){
format(string,sizeof(string),"Chat Clan - %s: %s",dbNombre(playerid),sms);
SendClientMessage(miembro,ChatColor,string);
}
}
return 1;
}
//Comando para mostrar los miembros del clan.
COMMAND:miembros(playerid,params[]){
new string[64], clanid=Usuario[playerid][uMiembro];
if(!clanid) return SendClientMessage(playerid,Error,"Usted no pertenece a un clan.");

SendClientMessage(playerid,Amarillo,"Miembros del clan conectados:");
for(new miembro=0;miembro<MAX_PLAYERS;miembro++){
if(Usuario[miembro][uMiembro] == clanid){
format(string,sizeof(string),"%s[%d] - {00ff00}Conectado",dbNombre(miembro),miembro);
SendClientMessage(playerid,Amarillo,string);
}
}
return 1;
}
//Llamado cuando un jugador presiona alguno de los botones de un dialogo creado con ShowPlayerDialog.
public OnDialogResponse(playerid,dialogid,response,listit em,inputtext[]){
new string[256];//Cadena
new clanid = -1;//Variable para establecer el ID disponible.
switch(dialogid){
case Dialog_Crear_Clan:{
if(!response) return 1;//Presiono Cancelar.
else if(response){
//verificar la cantidad de caracteres permitidos.
if(strlen(inputtext) < 4 || strlen(inputtext) > 31) return ShowPlayerDialog(playerid,Dialog_Crear_Clan,DIALOG _STYLE_INPUT,"{ffffff}[!]Nombre del clan:","{ffffff}Escribe en el siguiente \n{ffffff}espacio el nombre del clan:\n{ff0000}El nombre debe tener de 4 a 32 caracteres.","Aceptar","Cancelar");
for(new i=1;i<CLANES_MAXIMOS;i++){//Bucle, para revisar si aSlot esta disponible(esta en 0).
if(!Clanes[i][aSlot]){//Si aSlot, esta en 0(Disponible).
clanid = i;//Dar el ID disponible a clanid.
break;//Cortamos el bucle.
}
}
//Si no encuentra aSlot disponible, lanza este mensaje.
if(clanid == -1) return SendClientMessage(playerid,Error,"Error: No es posible crear mas clanes.");
//Asignarle Ocupado(1) al ID del clan.
Clanes[clanid][aSlot] = 1;
//Dar lider de clan al usuario creador.
Usuario[playerid][uLider] = 1;
Usuario[playerid][uMiembro] = clanid;
//Darle formato a la variable Clanes[clanid][aNombre], en este caso el nombre del clan.
format(Clanes[clanid][aNombre],32,"%s",inputtext);
//Darle formato a la variable Clanes[clanid][aLider], en este caso el nombre del lider.
format(Clanes[clanid][aLider],MAX_PLAYER_NAME,"%s",dbNombre(playerid));
//Darle formato a la informacion que mostraremos.
format(string,sizeof(string),"{ffff00}Su clan fue creado con exito.\n\n{FFA500}Nombre: %s\n\n{FFA500}Lider: %s\n\n\n{ffff00}Para mas informacion usar /claninfo.",Clanes[clanid][aNombre],Clanes[clanid][aLider]);
//Mostrar dialogo al jugador(para la informacion del clan).
ShowPlayerDialog(playerid,Dialog_Infor_Clan,DIALOG _STYLE_MSGBOX,"{ffffff}[!]Informacion:",string,"Aceptar","Cancelar");
}
}
}
return 1;
}
//Guardar Clanes.
forward GuardarClanes();
public GuardarClanes(){
new clanid, string[256], File:Archivo;
while(clanid < sizeof(Clanes)){
format(string,sizeof(string),"%d,%s,%s,%d,%d,%d,%d \n",
Clanes[clanid][aSlot],
Clanes[clanid][aNombre],
Clanes[clanid][aLider],
Clanes[clanid][aKills],
Clanes[clanid][aDeaths],
Clanes[clanid][aConquista],
Clanes[clanid][aColor]);
if(!clanid){
Archivo = fopen(Alianza,io_write);
}else{
Archivo = fopen(Alianza,io_append);
}
fwrite(Archivo,string);
clanid++;
fclose(Archivo);
}
}
//Cargar datos de los clanes.
forward CargarClanes();
public CargarClanes(){
new clanid, dbInfo[7][32], string[256], File:Archivo=fopen(Alianza,io_read);
if(Archivo){
while(clanid < sizeof(Clanes)){
fread(Archivo,string);
split(string,dbInfo,',');
Clanes[clanid][aSlot] = strval(dbInfo[0]);
strmid(Clanes[clanid][aNombre],dbInfo[1],0,strlen(dbInfo[1]),32);
strmid(Clanes[clanid][aLider],dbInfo[2],0,strlen(dbInfo[2]),24);
Clanes[clanid][aKills] = strval(dbInfo[3]);
Clanes[clanid][aDeaths] = strval(dbInfo[4]);
Clanes[clanid][aConquista] = strval(dbInfo[5]);
Clanes[clanid][aColor] = strval(dbInfo[6]);
clanid++;
}
fclose(Archivo);
}
return 1;
}
//Para prevenir futuros Bugs.
forward RetornarTrue();
public RetornarTrue(){
PuedeGuardarse = true;
}
//Usada en un timer para verificar si hay miembros en la zona
forward ActualizarZonas();
public ActualizarZonas(){
for(new z=0;z<sizeof(Zonas);z++){//Bucle, Zonas.
if(ZoneTakeOverTeam[z] == -1){//Si la zona no posee dueГ±o.
for(new t=1;t<CLANES_MAXIMOS;t++){
if(t == Zonas[z][zClan]) continue;
if(ObtenerMiembrosEnZona(z,t) >= MAX_MIEMBROS_CONQUISTA){
ZoneTakeOverTeam[z] = t;
GangZoneFlashForAll(Zonas[z][zGang],ColoursTableRGBA[Clanes[t][aColor]]);
ZoneTakeOverTime[z] = 0;
}
}
}else{
if(ObtenerMiembrosEnZona(z,ZoneTakeOverTeam[z]) > 0){
ZoneTakeOverTime[z]++;
if(ZoneTakeOverTime[z] >= MAX_TIEMPO_CONQUISTA){
GangZoneStopFlashForAll(Zonas[z][zGang]);
GangZoneShowForAll(Zonas[z][zGang],ColoursTableRGBA[Clanes[ZoneTakeOverTeam[z]][aColor]]);
Zonas[z][zClan] = ZoneTakeOverTeam[z];
for(new i=0,m=GetMaxPlayers();i<m;i++){
if(IsPlayerConnected(i)){
if(GetPlayerZone(i) == z && Usuario[i][uMiembro] == ZoneTakeOverTeam[z]){
GameTextForPlayer(i,"_~n~_~n~_~n~_~g~~h~~h~Han conquistado esta Base",2000,6);
}
}
}
Clanes[Zonas[z][zClan]][aConquista]++;
ZoneTakeOverTeam[z] = -1;
ZoneTakeOverTime[z] = 0;
}
}else{
ZoneTakeOverTeam[z] = -1;
GangZoneStopFlashForAll(Zonas[z][zGang]);
ZoneTakeOverTime[z] = 0;
}
}
}
}
//Funcion para saber que cantidad de miembros hay en la zona.
ObtenerMiembrosEnZona(zoneid,equipo){
new count = 0;
new Floatx, Floaty, Floatz;
for(new i=0,m=GetMaxPlayers();i<m;i++){
if(IsPlayerConnected(i)){
if(GetPlayerState(i) != PLAYER_STATE_WASTED && Usuario[i][uMiembro] == equipo){
GetPlayerPos(i, px, py, pz);
if(px > Zonas[zoneid][zPos][0] - ZONA_LONGITUD && py > Zonas[zoneid][zPos][1] - ZONA_LONGITUD && px < Zonas[zoneid][zPos][0] + ZONA_LONGITUD && py < Zonas[zoneid][zPos][1] + ZONA_LONGITUD){
count++;
}
}
}
}
return count;
}
//Sirve para dividir una cadena.
stock split(const strsrc[], strdest[][], delimiter){
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc)){
if(strsrc[i]==delimiter || i==strlen(strsrc)){
len = strmid(strdest[aNum], strsrc, li, i, 12;
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
//Detectar si un jugador esta en una zona especifica.
stock GetPlayerZone(playerid){
if(GetPlayerState(playerid) != PLAYER_STATE_WASTED){
new Floatx, Floaty, Floatz;
GetPlayerPos(playerid, px, py, pz);
for(new i=0;i<sizeof(Zonas);i++){
if(px > Zonas[i][zPos][0] - ZONA_LONGITUD && py > Zonas[i][zPos][1] - ZONA_LONGITUD && px < Zonas[i][zPos][0] + ZONA_LONGITUD && py < Zonas[i][zPos][1] + ZONA_LONGITUD) return i;
}
}
return -1;
}

Reply
#2

Puedes dar un estilo para el textdraw? una foto de algun ejemplo u otra cosa?
Reply
#3

Asi Seria donde Dice Clan: Plebe
Reply
#4

revivo necesito Ayuda
Reply
#5

їy que se supone que quieres que te ayudemos, has intentado comenzar con algo?

Puedes usar iPLEOMAX's TextDraw Editor
Reply
#6

puedes usar el editor de textdraw de zamaroth o iPLEOMAX's como dice aoEXE y men otra cosa que aprendi por +TheChaoz, es que si vas a mostrar codigos largos ponlo en pastebin
Reply
#7

Creas el textdraw una vez creado
defines la variable que por ejemplo es Clanes[clanid][aNombre] segun el sistema y despues colocas por ejemplo que actualize cada ves que spawnee o se use comando como expulsar o reclutar.

Ejemplo:


pawn Код:
format(string,sizeof(string),"Clan: %s",Clanes[clanid][aNombre]);
PlayerTextDrawSetString(playerid,Textdraw,string);PlayerTextDrawShow(playerid,Textdraw);
Reply
#8

Disculpen que reviva tema pero hice lo mismo que me pediste amigo :

Quote:

format(string,sizeof(string),"Clan: %s",Clanes[clanid][aNombre]);
PlayerTextDrawSetString(playerid,Textdraw,string); PlayerTextDrawShow(playerid,Textdraw);

y pues no me funciono le he buscado la mil maneras pero nada aun no me funciona vere si usando otro metodo me funciona o aсadiendo el sistema al LVADMIN4V2 que es donde tengo algo parecido a lo que el chico pide
Reply
#9

Quote:
Originally Posted by alexander_beltre
Посмотреть сообщение
Disculpen que reviva tema pero hice lo mismo que me pediste amigo :



y pues no me funciono le he buscado la mil maneras pero nada aun no me funciona vere si usando otro metodo me funciona o aсadiendo el sistema al LVADMIN4V2 que es donde tengo algo parecido a lo que el chico pide
pawn Код:
new PlayerText:pClan[MAX_PLAYERS];

pClan[playerid] = CreatePlayerTextDraw(playerid, x, y, "Clan: ");
PlayerTextDrawShow(playerid,pClan[playerid]);

new string[50];
format(string,sizeof(string),"Clan: %s",Clanes[Usuario[playerid][uMiembro]][aNombre]);
PlayerTextDrawSetString(playerid, pClan[playerid], string);
Reply
#10

hola amigo me puede ayuda en samp te pagares bien por lo que ayude si puedes necesito aprender pawno
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)