if(strcmp(cmd, "/robammu", true) == 0)
{
new success = random(2);
if(AmmuRobbedRecently == 1)
{
SendClientMessage(playerid, COLOR_GREY, "* This Location Was Robbed Recently, Try Again Later");
return 1;
}
if(PlayerInfo[playerid][pRobTime] >= 1)
{
SendClientMessage(playerid, COLOR_GREY, "* You already attempted or robbed a place recently, please wait.");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 10, 314.2548,-133.6627,999.6016) || IsPlayerInRangeOfPoint(playerid, 3,311.9589,-166.1407,999.6010))
{
if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40)
{
if(PlayerInfo[playerid][pDuty] == 0)
{
if(success == 1)
{
SendClientMessage(playerid, COLOR_ORANGE, "* You are now Robbing the Ammunation, please remain in the checkpoint for 290 Seconds!");
RobbingTime[playerid] = 95;
RobAmmuTimer = SetTimerEx("RobAmmu",3000,true,"i",playerid);
WantedPoints[playerid] = 5;
SetPlayerCriminal(playerid,255, "Robbing Ammunation");
PlayerInfo[playerid][pRobTime] = 3600;
AmmuRobbedRecently = 1;
SetTimer("UnsetAmmuRob",1500000,false);
OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "* You failed to rob ammunation!");
WantedPoints[playerid] = 2;
SetPlayerCriminal(playerid,255, "Attempting to rob Ammunation");
PlayerInfo[playerid][pRobTime] = 3600;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* Go Off duty first!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* You're not at Ammunation's Rob Point!");
return 1;
}
return 1;
}
public RobAmmu(playerid)
{
new string[128];
if(IsPlayerInRangeOfPoint(playerid, 10, 314.2548,-133.6627,999.6016) || IsPlayerInRangeOfPoint(playerid, 3,311.9589,-166.1407,999.6010))
{
if(RobbingTime[playerid] > 0)
{
RobbingTime[playerid] --;
GameTextForPlayer(playerid, "~w~Remain in the ~r~Pickup ~w~~until the time ends!", 1000,4);
}
else
{
RobbingTime[playerid] = 0;
KillTimer(RobAmmuTimer);
new gun = random;
new ammo = 500;
SafeGivePlayerWeapon(playerid, gun, ammo);
format(string, sizeof(string),"~w~You Robbed ~g~%s ~w~From ~y~Ammunation!", gun);
GameTextForPlayer(playerid, string, 6000, 4);
format(string, sizeof(string),"* You robbed %s From Ammunation!",gun);
SendClientMessage(playerid, COLOR_GREY, string);
WantedPoints[playerid] = 10;
SetPlayerCriminal(playerid,255, "Robbing Ammunation");
}
}
else
{
GameTextForPlayer(playerid, "~w~You Left The Checkpoint!", 1000,4);
RobbingTime[playerid] = 0;
KillTimer(RobAmmuTimer);
}
}
I think the string may be too large but i say only i THINK so. so i don't promise it is right
![]() |
new gun = random
new ammo = 500
= 500
= random
if( something == something_else )
{
print( "test" );
doSomething();
print( "test" );
doSomethingMore();
print( "test" );
while( you == something_totally_different )
{
print( "test" );
dontDoAnything();
print( "test" );
}
doOneLastThing();
print( "test" );
return true;
}
Add prints to "debug" the command. After each and every line, add a print, then see server.log after the server crashes and count the number of printed messages - you will then find out what line is the last to execute before the crash, thus probably being the one causing the crash.
If you don't understand, here's a tiny example: pawn Код:
|
print("hey");
if( IsPlayerConnected( playerid ))
{
mySendMessageFunc(playerid);
myOtherFunc();
return true;
}
if( IsPlayerConnected( playerid ))
{
print("test1");
mySendMessageFunc(playerid);
print("test2");
myOtherFunc();
print("test3");
return true;
}
C:\Users\new account\Desktop\Everything and Anything\Server\NEW SCRIPT!!!\Script\gamemodes\mazda.pwn(35741) : error 029: invalid expression, assumed zero C:\Users\new account\Desktop\Everything and Anything\Server\NEW SCRIPT!!!\Script\gamemodes\mazda.pwn(35756) : error 029: invalid expression, assumed zero C:\Users\new account\Desktop\Everything and Anything\Server\NEW SCRIPT!!!\Script\gamemodes\mazda.pwn(35763) : warning 225: unreachable code C:\Users\new account\Desktop\Everything and Anything\Server\NEW SCRIPT!!!\Script\gamemodes\mazda.pwn(35766) : error 029: invalid expression, assumed zero C:\Users\new account\Desktop\Everything and Anything\Server\NEW SCRIPT!!!\Script\gamemodes\mazda.pwn(35773) : warning 225: unreachable code C:\Users\new account\Desktop\Everything and Anything\Server\NEW SCRIPT!!!\Script\gamemodes\mazda.pwn(35776) : error 029: invalid expression, assumed zero C:\Users\new account\Desktop\Everything and Anything\Server\NEW SCRIPT!!!\Script\gamemodes\mazda.pwn(35783) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.