Server crash on command +rep -
fireranger11 - 19.05.2017
Server crashes whenever i type hns command
Код:
CMD:hns( playerid, params[ ] )
{
if ( IsPlayerInAnyVehicle( playerid ) )
return TD_MSG( playerid, 3000, "~r~~h~Please exit the vehicle!");
if (Iter_Count(HNS_Rank) > 20)
return SendClientMessage(playerid,COLOR_RED,""RED"Hide'N'Seek "WHITE"is full!");
if ( HNS_StartedEx == 1 )
return SendClientMessage(playerid,COLOR_RED,""RED"Hide'N'Seek "WHITE"has started!");
PlayerInfo[ playerid ][ ActionID ] = 9;
if ( HNS_Started == 0 )
{
SavePlayerCoords(playerid);
PlayerInfo[ playerid ][ inMini ] = 1;
Iter_Add(HNS_Rank, playerid);
Iter_Add(Var_Seeker, playerid);
HNS_Started = 1;
HNS_Count = 60;
GameTextForAll( "~g~~h~Hide'N'Seek ~w~minigame starting in ~r~60 ~w~seconds! ~g~~h~/hns ~w~to join!", 3000, 4 );
SetTimerEx( "StartSeek", 1000, 0, "i", playerid );
TogglePlayerControllable( playerid, false );
ResetPlayerWeapons(playerid);
GivePlayerWeapon( playerid, 38, 99999 );
SetPlayerInterior( playerid, 2 );
SetPlayerPos( playerid, 2567.6086, -1294.1406, 1063.2520 );
SetPlayerFacingAngle( playerid, 6.9141 );
SetCameraBehindPlayer( playerid );
return ( 1 );
}
else
{
SavePlayerCoords(playerid);
Iter_Add(HNS_Rank, playerid);
TD_MSG( playerid, 3000, "~w~Use ~r~~h~/hideme ~w~when you're hidden!" );
ResetPlayerWeapons( playerid );
SetPlayerInterior( playerid, 2 );
SetPlayerPos( playerid, 2559.0579, -1297.1764, 1060.9844 );
SetPlayerFacingAngle( playerid, 263.8967 );
}
new string3[128];
format(string3,sizeof string3,"~R~[MG] - ~w~%s ~W~has teleported to(/HNS)!",GetName( playerid ));
SendBoxMsg(string3);
return ( 1 );
}
Re: Server crash on command -
Kane - 19.05.2017
You should really indent but maybe the
return ( 1 );?
Re: Server crash on command -
zedshadowzw - 20.05.2017
I corrected some of your mistakes here, You probably didn''t compile it before running it into your server..
Код:
CMD:hns( playerid, params[ ] )
{
if ( IsPlayerInAnyVehicle( playerid ) )
return TD_MSG( playerid, 3000, "~r~~h~Please exit the vehicle!");
if (Iter_Count(HNS_Rank) > 20)
return SendClientMessage(playerid,COLOR_RED,""RED"Hide'N'Seek "WHITE"is full!");
if ( HNS_StartedEx == 1 )
return SendClientMessage(playerid,COLOR_RED,""RED"Hide'N'Seek "WHITE"has started!");
PlayerInfo[ playerid ][ ActionID ] = 9;
if ( HNS_Started == 0 )
{
SavePlayerCoords(playerid);
PlayerInfo[ playerid ][ inMini ] = 1;
Iter_Add(HNS_Rank, playerid);
Iter_Add(Var_Seeker, playerid);
HNS_Started = 1;
HNS_Count = 60;
GameTextForAll( "~g~~h~Hide'N'Seek ~w~minigame starting in ~r~60 ~w~seconds! ~g~~h~/hns ~w~to join!", 3000, 4 );
SetTimerEx( "StartSeek", 1000, 0, "i", playerid );
TogglePlayerControllable( playerid, false );
ResetPlayerWeapons(playerid);
GivePlayerWeapon( playerid, 38, 99999 );
SetPlayerInterior( playerid, 2 );
SetPlayerPos( playerid, 2567.6086, -1294.1406, 1063.2520 );
SetPlayerFacingAngle( playerid, 6.9141 );
SetCameraBehindPlayer( playerid );
return ( 1 );
}
else
{
SavePlayerCoords(playerid);
Iter_Add(HNS_Rank, playerid);
TD_MSG( playerid, 3000, "~w~Use ~r~~h~/hideme ~w~when you're hidden!" );
ResetPlayerWeapons( playerid );
SetPlayerInterior( playerid, 2 );
SetPlayerPos( playerid, 2559.0579, -1297.1764, 1060.9844 );
SetPlayerFacingAngle( playerid, 263.8967 );
}
new string3[128];
format(string3,sizeof string3,"~R~[MG] - ~w~%s ~W~has teleported to(/HNS)!",GetName( playerid ));
SendBoxMsg(string3);
return 1;
}
Re: Server crash on command -
fireranger11 - 20.05.2017
Still crashing :/
Re: Server crash on command -
fireranger11 - 20.05.2017
Код:
new
Iterator:Var_Seeker<MAX_PLAYERS>,
Iterator:HNS_Rank<MAX_PLAYERS>
;
new HNS_Started;
new HNS_Count;
new HNS_StartedEx;
function StartSeek( playerid )
{
if ( HNS_Count == 0 )
{
foreach(new i: HNS_Rank)
{
if ( GetPVarInt( i, "Hidden" ) != 1 && Iter_Contains(Var_Seeker, i) == 0 )
{
new
next
;
Iter_SafeRemove(HNS_Rank, i, next);
ResetPlayerWeapons( i );
LoadPlayerCoords(i);
SendClientMessage( i, -1, "INFO: "WHITE"You are removed from the \"{FF0000}/hns"WHITE"\". Reason: {FF0000}Need to use /hideme !" );
DeletePVar( i, "Hidden" );
i = next;
}
}
if(Iter_Count(HNS_Rank) > 1)
{
HNS_Started = 0;
HNS_StartedEx = 1;
SetTimer( "SeekTime", 300000, 0 );
foreach(new i: Var_Seeker)
{
if(Iter_Contains(Var_Seeker, i))
{
TogglePlayerControllable( i, true );
TD_MSG( i, 3000, "~g~~h~Find all hidders !!!" );
}
}
}
else
{
foreach(new i: HNS_Rank)
{
if(Iter_Contains(HNS_Rank, i))
{
Iter_Clear(HNS_Rank);
Iter_Clear(Var_Seeker);
PlayerInfo[ playerid ][ inMini ] = 0;
PlayerInfo[ playerid ][ ActionID ] = 0;
ResetPlayerWeapons( i );
LoadPlayerCoords(i);
SendClientMessage( i, 0xFFFF00FF, "Minigame canceled! Minium are 2 players to can start!" );
TogglePlayerControllable( i, true );
}
}
HNS_Started = 0;
HNS_StartedEx = 0;
Iter_Clear(HNS_Rank);
Iter_Clear(Var_Seeker);
}
}
else
{
new gsString [ 3 ];
SetTimerEx( "StartSeek", 1000, 0, "i", playerid );
gsString[ 0 ] = EOS;
HNS_Count--;
format( gsString, 144, "~w~Starting in ~r~~h~%d~n~~w~seconds", HNS_Count );
TD_MSG( playerid, 3000, gsString );
return ( 1 );
}
return ( 1 );
}
function SeekTime( )
{
if(Iter_Count(HNS_Rank) > 3)
{
foreach(new i: HNS_Rank)
{
if (Iter_Contains(HNS_Rank, i))
{
ResetPlayerWeapons( i );
LoadPlayerCoords(i);
TogglePlayerControllable( i, true );
SendClientMessage( i, 0x33AA33FF, "Hidders won!" );
}
}
HNS_Started = 0;
HNS_StartedEx = 0;
Iter_Clear(HNS_Rank);
Iter_Clear(Var_Seeker);
}
return ( 1 );
}
CMD:hns( playerid, params[ ] )
{
if ( IsPlayerInAnyVehicle( playerid ) )
return TD_MSG( playerid, 3000, "~r~~h~Please exit the vehicle!");
if (Iter_Count(HNS_Rank) > 20)
return SendClientMessage(playerid,COLOR_RED,""RED"Hide'N'Seek "WHITE"is full!");
if ( HNS_StartedEx == 1 )
return SendClientMessage(playerid,COLOR_RED,""RED"Hide'N'Seek "WHITE"has started!");
PlayerInfo[ playerid ][ ActionID ] = 9;
if ( HNS_Started == 0 )
{
SavePlayerCoords(playerid);
PlayerInfo[ playerid ][ inMini ] = 1;
Iter_Add(HNS_Rank, playerid);
Iter_Add(Var_Seeker, playerid);
HNS_Started = 1;
HNS_Count = 60;
GameTextForAll( "~g~~h~Hide'N'Seek ~w~minigame starting in ~r~60 ~w~seconds! ~g~~h~/hns ~w~to join!", 3000, 4 );
SetTimerEx( "StartSeek", 1000, 0, "i", playerid );
TogglePlayerControllable( playerid, false );
ResetPlayerWeapons(playerid);
GivePlayerWeapon( playerid, 38, 99999 );
SetPlayerInterior( playerid, 2 );
SetPlayerPos( playerid, 2567.6086, -1294.1406, 1063.2520 );
SetPlayerFacingAngle( playerid, 6.9141 );
SetCameraBehindPlayer( playerid );
return ( 1 );
}
else
{
SavePlayerCoords(playerid);
Iter_Add(HNS_Rank, playerid);
TD_MSG( playerid, 3000, "~w~Use ~r~~h~/hideme ~w~when you're hidden!" );
ResetPlayerWeapons( playerid );
SetPlayerInterior( playerid, 2 );
SetPlayerPos( playerid, 2559.0579, -1297.1764, 1060.9844 );
SetPlayerFacingAngle( playerid, 263.8967 );
}
new string3[128];
format(string3,sizeof string3,"~R~[MG] - ~w~%s ~W~has teleported to(/HNS)!",GetName( playerid ));
SendBoxMsg(string3);
return 1;
}
Re: Server crash on command -
fireranger11 - 21.05.2017
Bump
Re: Server crash on command -
fireranger11 - 22.05.2017
help
Re: Server crash on command -
fireranger11 - 23.05.2017
anyone?
Re: Server crash on command -
YouHack - 23.05.2017
Replace return ( 1 ) by return 1;
Re: Server crash on command -
DRIFT_HUNTER - 23.05.2017
Show us SavePlayerCoords