SA-MP Forums Archive
crash help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: crash help (/showthread.php?tid=529240)



crash help - 9noober - 01.08.2014

What is this problemit crash my server.

PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#include <foreach>
#include <sscanf2>
#include <dini>
#include <Colours>
#include <streamer>
new vipout,vipin;
new 
objwindow;
new 
ttd;
#define MAX_VIP 3
#define PlayerFile "Vip/%s.ini"
#pragma tabsize 0
enum dData
{
   
Vip
}
new 
PlayerInfo[MAX_PLAYERS][dData];
public 
OnFilterScriptInit()
{
CreateDynamicObject(19128, -1217.94666, -387.14209518.99902,   0.000000.000000.00000,-1,5);
CreateDynamicObject(19128, -1214.02612, -383.16626518.99902,   0.000000.00000, -0.06000,-1,5);
CreateDynamicObject(19128, -1214.01587, -387.13086518.99902,   0.000000.000000.00000,-1,5);
CreateDynamicObject(19128, -1217.97839, -383.16403518.99902,   0.000000.000000.00000,-1,5);
CreateDynamicObject(19128, -1218.00427, -379.19666518.99902,   0.000000.000000.00000,-1,5);
CreateDynamicObject(19128, -1214.05835, -379.21533518.99902,   0.000000.000000.00000,-1,5);
CreateDynamicObject(19128, -1214.08606, -375.24207518.99902,   0.000000.000000.24000,-1,5);
CreateDynamicObject(19128, -1218.03247, -375.27084518.99902,   0.000000.000000.36000,-1,5);
CreateDynamicObject(16151, -1209.59485, -378.44180518.96667,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1551, -1210.25610, -375.19528519.82001,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1551, -1210.16150, -375.11597519.82001,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1667, -1210.24048, -377.13983519.69263,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1667, -1210.50806, -378.04355519.69263,   0.000000.000000.00000,-1,5);
CreateDynamicObject(2222, -1210.57654, -376.73990519.67273,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1726, -1211.54565, -382.83499518.95569,   0.000000.000000.00000,-1,5);
CreateDynamicObject(2321, -1211.21484, -385.10190518.96478,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1717, -1209.68848, -386.99625518.96710,   0.000000.00000, -224.58005,-1,5);
objwindow CreateDynamicObject(1649, -1210.02478, -372.76074520.62000,   0.000000.00000180.42030,-1,5);
CreateDynamicObject(14623, -1213.76074, -350.57208524.38000,   0.000000.000000.00000,-1,5);
objwindow CreateDynamicObject(1649, -1218.04407, -373.01587520.62000,   0.000000.00000180.42030,-1,5);
CreateDynamicObject(14537, -1213.98840, -350.37579520.76611,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1978, -1203.67126, -350.19666519.88593,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1978, -1224.89404, -350.55569519.88593,   0.000000.00000, -180.47987,-1,5);
CreateDynamicObject(2785, -1202.63477, -329.82236519.59906,   0.000000.00000, -89.46007,-1,5);
CreateDynamicObject(1902, -1225.21228, -349.32141519.71320,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1566, -1217.29309, -312.63956524.03137,   0.000000.000000.00000,-1,5);
CreateDynamicObject(1566, -1214.15259, -312.64743524.03137,   0.000000.00000, -180.53981,-1,5);
objwindow CreateDynamicObject(1649, -1218.40845, -389.21640520.53223,   0.000000.00000180.42030,-1,5);
objwindow CreateDynamicObject(1649, -1209.79675, -389.19724520.50000,   0.000000.00000180.42030,-1,5);
objwindow CreateDynamicObject(1649, -1218.01624, -373.13766520.62000,   0.000000.000000.06031,-1,5);
objwindow CreateDynamicObject(1649, -1210.07336, -372.80917520.62000,   0.000000.000000.24034,-1,5);
objwindow CreateDynamicObject(1649, -1209.78442, -389.20047523.76379,   0.000000.00000180.42030,-1,5);
objwindow CreateDynamicObject(1649, -1218.41650, -389.21240523.80835,   0.000000.00000180.42030,-1,5);
objwindow CreateDynamicObject(1649, -1214.14050, -389.18695520.55334,   0.000000.00000180.06032,-1,5);
CreateDynamicObject(4242, -1210.91187, -207.64380554.86304,   17.000000.000000.00000,-1,5);
objwindow CreateDynamicObject(1649, -1214.14050, -389.18695523.78577,   0.000000.00000180.06032,-1,5);
ttd CreateDynamicObject(19353, -1221.56519, -368.53357520.63837,   0.000000.0000062.94001,-1,5);
ttd CreateDynamicObject(19353, -1205.90637, -368.52194520.63843,   0.000000.00000, -62.94000,-1,5);
vipout CreateDynamicCP(-1881.3136,822.9650,35.1770, -,-1,100.0);
vipin CreateDynamicCP(-1215.7355,-313.0395,523.8566, -,-1,100.0);
SetObjectMaterialText(ttd,"{00ff00}Thanks to Dykw",  0OBJECT_MATERIAL_SIZE_32x32,"Arial"8000xFFFF82000xFF000000OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
       new 
file[256], name[MAX_PLAYER_NAME];
       
GetPlayerName(playerid,name,sizeof(name));
       
format(file,sizeof(file),PlayerFile,name);
       if(!
dini_Exists(file) )
       {
             
dini_Create(file);
             
dini_Set(file,"Name",name);
             
dini_IntSet(file,"Vip",0);
             
PlayerInfo[playerid][Vip] = 0;
       }
       else
       {
              
PlayerInfo[playerid][Vip] = dini_Int(file,"Vip");
              new 
string[256];
              
format(string,sizeof(string),"[VIP]:{ffffff}Your vip level is [$d]",PlayerInfo[playerid][Vip]);
              
SendClientMessage(playerid,COLOR_GREEN,string);
       }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
      new 
file[256], name[MAX_PLAYER_NAME];
       
GetPlayerName(playerid,name,sizeof(name));
       
format(file,sizeof(file),PlayerFile,name);
       if(
dini_Exists(file) )
       {
            
dini_IntSet(file,"Vip",PlayerInfo[playerid][Vip]);
       }
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
     if(
text[0] == 'v' )
     {
        if(
PlayerInfo[playerid][Vip] > 0)
        {
               new 
name[MAX_PLAYER_NAME];
               
GetPlayerName(playerid,name,sizeof(name));
               new 
string[256];
               
format(string,sizeof(string),"[Vip]%s[rank: %d]:{ffffff}%s",name,PlayerInfo[playerid][Vip],text[0]);
               
MessageToVips(COLOR_GREEN,string);
               return 
0;
             }
             }
            return 
1;
}
CMD:setvip(playerid,params[])
{
   new 
idlevel;
   if(
sscanf(params,"ud",id,level) ) return SendClientMessage(playerid,COLOR_RED,"[USAGE]:{FFFFFF}/setvip [ID][ level]");
    if(!
IsPlayerAdmin(playerid) ) return SendClientMessage(playerid,COLOR_RED,"[ERROR]:{FFFFFF}You can't use this command.This is an administrator command.");
     if(!
IsPlayerConnected(id) ) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
     else
     {
    new 
name[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
     
GetPlayerName(id,playername,sizeof(playername));
    new 
fstring[256], zstring[256];
      
format(fstring,sizeof(fstring),"[ADMIN]:{FFFFFF}%s has set your V.I.P level to %d",name,level);
      
format(zstring,sizeof(zstring),"[ADMIN]:{FFFFFF}You maked %s level %d",playername,level);
      
SendClientMessage(playerid,COLOR_GREEN,zstring);
      
SendClientMessage(id,COLOR_GREEN,fstring);
      
PlayerInfo[id][Vip] = level;
     }
  return 
1;
}
stock MessageToVips(color, const string[])
{
   foreach(
Player,i)
   {
          if(
IsPlayerConnected(i) == 1)
          if(
PlayerInfo[i][Vip] >= 1)
          
SendClientMessage(i,color,string);
   }
}
public 
OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == vipout)
      {
          if(!
PlayerInfo[playerid][Vip] >= 1)return SendClientMessage(playerid,COLOR_GREEN,"[VIP]:{FFFFFF}Only vip can go in the vip lounge.");
          {
          
SetTimerEx("togglecp"2000false"i"playerid);
        
TogglePlayerDynamicCP(playeridvipin0);
        
PlayAudioStreamForPlayer(playerid,"http://7609.live.streamtheworld.com:80/977_HITS_SC");
           if(
IsPlayerInAnyVehicle(playerid))return 1;
        
SetPlayerPos(playerid,-1215.7355,-313.0395,523.8566);
        
SetPlayerInterior(playerid,5);
        
SetPlayerFacingAngleplayerid180 );
        }
    }
    else if(
checkpointid == vipin)
    {
        
SetTimerEx("togglecp"2000false"i"playerid);
        
TogglePlayerDynamicCP(playeridvipout0);
        if(
IsPlayerInAnyVehicle(playerid))return 1;
        
StopAudioStreamForPlayer(playerid);
        
SetPlayerPos(playerid, -1881.3136,822.9650,35.1770);
        
SetPlayerInterior(playerid0);
        
SetPlayerFacingAngleplayerid45 );
    }
    return 
1;
}
forward togglecp(playerid);
public 
togglecp(playerid)
{
    
TogglePlayerDynamicCP(playeridvipout1);
    
TogglePlayerDynamicCP(playeridvipin1);
    return 
1;




Re: crash help - McBan - 01.08.2014

Variables under Defines.


Re: crash help - Konstantinos - 01.08.2014

Load crashdetect plugin and after a server crash, post the server log.

Quote:
Originally Posted by McBan
Посмотреть сообщение
Variables under Defines.
Nothing wrong with it as long as the variable is not used in a macro.