/robcasino = Restart Why?
#1

Hello, When i typing /robcasino at CP Server Restart Why?

Код:
CMD:robcasino(playerid, params[])
{
   if(!IsPlayerInDynamicCP(playerid, CP_robdrag)) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: You must be in checkpoint Four Dragon Casino");
   {
	  if(Dragonrobbedrecently >=1)
	  {
		   SendClientMessage(playerid, COLOR_RED, "[PICKUP] Go Pickup the objects you have 30 Secdons");
	       SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 5);
	       GameTextForPlayer(playerid, "DO NOT LEAVE CHECKPOINT", 500, 1);
	       SetTimer("DragonRobbery", 60000, false);
	       DragonObjects[1] = CreatePickup(1212, 18, 1962.3412,1009.9411,992.4688,-1);
	       DragonObjects[2] = CreatePickup(1212, 18, 1958.0300,1010.0934,992.4688,-1);
	       DragonObjects[3] = CreatePickup(1212, 18, 1958.7378,1015.8269,992.4688,-1);
	       DragonObjects[4] = CreatePickup(1212, 18, 1958.7378,1020.2450,992.4688,-1);
	       DragonObjects[5] = CreatePickup(1212, 18, 1958.0302,1025.4569,992.4688,-1);
	       DragonObjects[6] = CreatePickup(1212, 18, 1962.3405,1025.6857,992.4688,-1);
	       DragonObjects[7] = CreatePickup(1212, 18, 1963.9730,1020.3441,992.4688,-1);
	       DragonObjects[8] = CreatePickup(1212, 18, 1963.9764,1015.7001,992.4688,-1);
	  }
      ROBBING_Dragon[playerid] = 15;
      Dragonrobbedrecently = 200;
      }
   return 1;
}
Reply
#2

Right after you type or after 60 seconds? and show server_log when it restarts (or crashes).

-Load crashdetect
Reply
#3

Are you using the latest version of streamer(both include and plugin).
Try using crash detect like iLearner said
Reply
#4

Here you go ...

i added crashdetect
Код:
[13:33:37] [debug] Server crashed while executing Checkpoints.amx
[13:33:37] [debug] AMX backtrace:
[13:33:37] [debug] #0 native SendClientMessageToAll () from sampsvr-port_9883
[13:33:37] [debug] #1 00002e20 in public DragonRobbery () from Checkpoints.amx
[13:33:37] [debug] Native backtrace:
[13:33:37] [debug] #0 dbdde9f0 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so
[13:33:37] [debug] #1 dbdd7a62 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[13:33:37] [debug] #2 dbdd8764 in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[13:33:37] [debug] #3 dbdda6b4 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[13:33:37] [debug] #4 dbdde31d in ?? () from plugins/crashdetect.so
[13:33:37] [debug] #5 dc134410 in __kernel_rt_sigreturn () from linux-gate.so.1
[13:33:37] [debug] #6 dbe4b508 in _IO_vfprintf () from /lib32/libc.so.6
[13:33:37] [debug] #7 dbe6b7a2 in vsprintf () from /lib32/libc.so.6
[13:33:37] [debug] #8 080add67 in ?? () from ./sampsvr-port_9883
[13:33:37] [debug] #9 080d9e51 in ?? () from ./sampsvr-port_9883
[13:33:37] [debug] #10 080950e4 in ?? () from ./sampsvr-port_9883
[13:33:37] [debug] #11 dbdd94d3 in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[13:33:37] [debug] #12 00000000 in nil ()
Reply
#5

I dont know exactly where, but you've tried to use SendClientMessageToAll without formatting the message, eg:

SendClientMessageToAll(-1, "Player %d Joined Server",playerid);
Reply
#6

Did you mean this?

Код:
    new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s has joined the server", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
Reply
#7

Look in timer's callback DragonRobbery. The mistake is what iLearner said: using specifiers directly in client messages without formatting first will result in server crash.
Reply
#8

Delete The /robcasino and it will not restart
Reply
#9

Hi Konstantions, Here you go, The Code of DragonRobbery

What's wrong here?
Код:
forward DragonRobbery();
public DragonRobbery()
{
   for(new i=0; i<MAX_PLAYERS; i++)
   {
	   if(IsPlayerConnected(i))
	   {
		  if(ROBBING_Dragon[i] >1)
		  {
			  ROBBING_Dragon[i] --;
			  new time[20];
			  format(time,sizeof(time), "~r~Robbery Time:%d",ROBBING_Dragon[i]);
			  SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) +5);
			  GameTextForPlayer(i,time,500,3);
			  SendClientMessageToAll(COLOR_RED, "[ROBBING]: %s(%d) has robbed Four Dragon Casino Total: %d");
			  CP_DragPoint = CreateDynamicCP(2026.9276,1028.0477,10.8203,2.0, -1, -1, -1, 100.0);

		  }
	   }
   }
   return 1;
}
Reply
#10

Код:
SendClientMessageToAll(COLOR_RED, "[ROBBING]: %s(%d) has robbed Four Dragon Casino Total: %d");
Format first.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)