[Ajuda] Por que esse cуdigo fecha o Server?
#1

Por que quando eu chamo esse stock CriarGang(playerid) ele fecha o Server?
stock CriarGang(playerid)
Код:
stock CriarGang(playerid)
{
	new gcontagem = DOF2_GetInt("/gangs/contagem.txt", "contagem");
	new str[512];
	if(gcontagem >= 0)
	{
		gcontagem++;
	    format(string, sizeof string, "/gangs/%d.cok", gcontagem);
	    format(str, sizeof str, ARQUIVOCONF, pnome(playerid));
	    DOF2_CreateFile(string);
		DOF2_SetString(string, "NomeGang", nmgang);
		DOF2_SetString(string, "CGang", cgang);
		DOF2_SetInt("/gangs/contagem.txt", "contagem", gcontagem);
		DOF2_SetInt(str, "NivelGang", 3);
		DOF2_SetInt(str, "NGang", gcontagem);
		DOF2_SetBool(str, "Gang", true);
		gang[playerid] = true;
		SetPlayerColor(playerid, 0xFF0000FF);
		SendClientMessage(playerid, amarelo, "[COK] Vocк criou a gang com sucesso. Para convidar vб ao menu gang com /gang");
	}
	if(gcontagem == 100) SendClientMessage(playerid, vermelho, "[COK] Nъmero mбximo de gangs excedido");
	return 1;
}
Reply
#2

Quote:
Originally Posted by [XPG]MarlonCS
Посмотреть сообщение
Por que quando eu chamo esse stock CriarGang(playerid) ele fecha o Server?
stock CriarGang(playerid)
Код:
stock CriarGang(playerid)
{
	new gcontagem = DOF2_GetInt("/gangs/contagem.txt", "contagem");
	new str[512];
	if(gcontagem >= 0)
	{
		gcontagem++;
	    format(string, sizeof string, "/gangs/%d.cok", gcontagem);
	    format(str, sizeof str, ARQUIVOCONF, pnome(playerid));
	    DOF2_CreateFile(string);
		DOF2_SetString(string, "NomeGang", nmgang);
		DOF2_SetString(string, "CGang", cgang);
		DOF2_SetInt("/gangs/contagem.txt", "contagem", gcontagem);
		DOF2_SetInt(str, "NivelGang", 3);
		DOF2_SetInt(str, "NGang", gcontagem);
		DOF2_SetBool(str, "Gang", true);
		gang[playerid] = true;
		SetPlayerColor(playerid, 0xFF0000FF);
		SendClientMessage(playerid, amarelo, "[COK] Vocк criou a gang com sucesso. Para convidar vб ao menu gang com /gang");
	}
	if(gcontagem == 100) SendClientMessage(playerid, vermelho, "[COK] Nъmero mбximo de gangs excedido");
	return 1;
}
Manda o serverlog....
Reply
#3

Quote:
Originally Posted by Nork
Посмотреть сообщение
Manda o serverlog....
Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3z-R4, ©2005-2014 SA-MP Team

[14:50:05] 
[14:50:05] Server Plugins
[14:50:05] --------------
[14:50:05]  Loading plugin: xStreamer.dll
[14:50:05] xStreamer plugin loaded
[14:50:05]   Loaded.
[14:50:05]  Loading plugin: sscanf.dll
[14:50:05] 

[14:50:05]  ===============================

[14:50:05]       sscanf plugin loaded.     

[14:50:05]    © 2009 Alex "******" Cole

[14:50:05]    0.3d-R2 500 Players "dnee"

[14:50:05]  ===============================

[14:50:05]   Loaded.
[14:50:05]  Loaded 2 plugins.

[14:50:05] 
[14:50:05] Filterscripts
[14:50:05] ---------------
[14:50:05]   Loading filterscript 'tunar.amx'...
[14:50:05]   Loading filterscript 'prop.amx'...
[14:50:05] ===================================
[14:50:05] ||    Created 0 Properties     ||
[14:50:05] ||0 of the properties are bought||
[14:50:05] ===================================
[14:50:05] -------------------------------------------------
[14:50:05] Property-System by =>Sandra<= Succesfully loaded!
[14:50:05] -------------------------------------------------
[14:50:05]   Loading filterscript 'x.amx'...
[14:50:05] xStreamer: xStreamer filterscript has been detected
[14:50:05]   Loading filterscript 'obj.amx'...
[14:50:05]   Loaded 4 filterscripts.

[14:50:05] 
-------------------------------------
[14:50:05] _-_CITY OF KILLERS BETA ~~ 0.3z_-_

[14:50:05]          Coded By                   
[14:50:05]                      --> STBOY GAMES
[14:50:05]                          PT-BR      
[14:50:05] -------------------------------------

[14:50:05] Number of vehicle models: 149
[14:50:22] Incoming connection: 192.168.1.100:53824
[14:50:23] [join] MarlonCS has joined the server (0:192.168.1.100)
Nada estranho, eu acho
Reply
#4

As pastas que estб carregando estгo criadas ?
Reply
#5

Quote:
Originally Posted by ReyMysterio
Посмотреть сообщение
As pastas que estб carregando estгo criadas ?
Ele chega a criar o arquivo, mas na hora de setar o CGang (que seria a cor da gang) ele deixa (null) no arquivo e o server й fechado.
Isto й o que estб no comando /criargang

Код:
// /gangcriar
...
			GivePlayerMoney(playerid, -10000);
 			format(cgang, 11, "0x%sFF", inputtext);
			CriarGang(playerid);
Reply
#6

Porque nгo tenta usar o plugin crashdetect ?
Reply
#7

Quote:
Originally Posted by ReyMysterio
Посмотреть сообщение
Porque nгo tenta usar o plugin crashdetect ?
Olha o que apareceu:
Код:
[15:28:21] [debug] Server crashed while executing cok.amx
[15:28:21] [debug] AMX backtrace:
[15:28:21] [debug] #0 native SendClientMessage () from samp-server.exe
[15:28:21] [debug] #1 000632f0 in ?? (0) from cok.amx
[15:28:21] [debug] #2 00056704 in public OnDialogResponse (0, 29, 1, -1, 1284984) from cok.amx
[15:28:21] [debug] Native backtrace:
[15:28:21] [debug] #0 0049940c in ?? () from samp-server.exe
[15:28:21] [debug] #1 02000002 in ?? ()
[15:28:21] [debug] #2 0047e19e in ?? () from samp-server.exe
[15:28:21] [debug] Server crashed while executing cok.amx
[15:28:21] [debug] AMX backtrace:
[15:28:21] [debug] #0 native SendClientMessage () from samp-server.exe
[15:28:21] [debug] #1 000632f0 in ?? (0) from cok.amx
[15:28:21] [debug] #2 00056704 in public OnDialogResponse (0, 29, 1, -1, 1284984) from cok.amx
[15:28:21] [debug] Native backtrace:
[15:28:21] [debug] #0 773d70de in ?? () from C:\WINDOWS\SYSTEM32\ntdll.dll
[15:28:21] [debug] #1 773d6946 in ?? () from C:\WINDOWS\SYSTEM32\ntdll.dll
[15:28:21] [debug] #2 00494611 in ?? () from samp-server.exe
[15:28:21] [debug] #3 0044e0d9 in ?? () from samp-server.exe
[15:28:21] [debug] #4 00458cfc in ?? () from samp-server.exe
[15:28:21] [debug] #5 0045b4ca in ?? () from samp-server.exe
[15:28:21] [debug] #6 70097c19 in ?? () from plugins\crashdetect.dll
[15:28:21] [debug] #7 756cc329 in ?? () from C:\WINDOWS\SYSTEM32\KERNELBASE.dll
[15:28:21] [debug] #8 756cc346 in ?? () from C:\WINDOWS\SYSTEM32\KERNELBASE.dll
PROBLEMA RESOLVIDO!
Era apenas o SendClientMessage ... Vai entender.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)