Server crashing rep+ fast
#1

why server got crashed when player use jetpack

Код:
new Jetpack;
Код:
forward StealAgain();
public StealAgain()
{
Jetpack = CreatePickup(370,1,268.7132,1883.5077,-30.0938,-1);
return 1;
}
Код:
Jetpack = CreatePickup(370,1,268.7132,1883.5077,-30.0938,-1);
Код:
 public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == CP1)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 10000$", "Select", "Cancel");
}
else if(pickupid == TP)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 10000$", "Select", "Cancel");
}
else if(pickupid == TP1)
{ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 10000$", "Select", "Cancel");
}
else if(pickupid == health)
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,COLOR_RED,"You don't have enough money to buy this!");
SetPlayerHealth(playerid,100);
GivePlayerMoney(playerid,-10000);
SendClientMessage(playerid,808080,"You're successfully healed for 10000$");
}
if(pickupid == Jetpack)
{
        if(gTeam[playerid] == C1) return 0;
        else
        {
                SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
                SendClientMessage(playerid,-1,"{FF0000}[JETPACK]{ffffff}You stole the jetpack, quickly take it to the place on the map.");
                DestroyPickup(Jetpack);
                SetTimer("StealAgain",1200000,false);
                SetPlayerMapIcon(playerid,Ammu,-396.3205,2236.0513,42.4297,20,0,MAPICON_GLOBAL);
                for(new i=0; i <MAX_PLAYERS; i++)
                {
                    if(gTeam[i] == C1)
                    {
                	GameTextForPlayer(i,"~b~Cops ~N~~W~intruder stole the ~N~~R~jetpack~W~ ~N~stop him immediately!");
                        }
                }
        }
}
return 1;
}
help fast
Reply
#2

Use this

set the type of pickup 3 not 1

Jetpack = CreatePickup(370,3,268.7132,1883.5077,-30.0938,-1);

Quote:

if(pickupid == Jetpack)
{
if(gTeam[playerid] == C1) return 0;
else
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USE JETPACK);
SendClientMessage(playerid,-1,"{FF0000}[JETPACK]{ffffff}You stole the jetpack, quickly take it to the place on the map.");
SetTimer("StealAgain",1200000,false);
SetPlayerMapIcon(playerid,Ammu,-396.3205,2236.0513,42.4297,20,0,MAPICON_GLOBAL);
for(new i=0; i <MAX_PLAYERS; i++)
{
if(gTeam[i] == C1)
{
SendClientMessage(i,0xFFFF00AA,"Cops {FFFFFF} intruder stole the jetpack stop him immediately!");
}
}
}
}

Reply
#3

26 Errors.
Reply
#4

Send me the errors
Reply
#5

Give a try:
PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == CP1)
    {
        
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Briefcase""Health - 5000$\nArmour - 10000$""Select""Cancel");
        return 
1;
    }
    if(
pickupid == TP)
    {
        
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Briefcase""Health - 5000$\nArmour - 10000$""Select""Cancel");
        return 
1;
    }
    if(
pickupid == TP1)
    {
        
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Briefcase""Health - 5000$\nArmour - 10000$""Select""Cancel");
        return 
1;
    }
    if(
pickupid == health)
    {
        if(
GetPlayerMoney(playerid) < 10000)
        {
            
SendClientMessage(playerid,COLOR_RED,"You don't have enough money to buy this!");
            return 
1;
        }
        
SetPlayerHealth(playerid100.0);
        
GivePlayerMoney(playerid, -10000);
        
SendClientMessage(playerid808080"You're successfully healed for 10000$");
        return 
1;
    }
    if(
pickupid == Jetpack)
    {
        if(
gTeam[playerid] == C1)
        {
            return 
1;
        }
        else
        {
            
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USEJETPACK);
            
SetPlayerMapIcon(playeridAmmu, -396.32052236.051342.4297200MAPICON_GLOBAL);
            
SendClientMessage(playerid,-1,"{FF0000}[JETPACK]{ffffff}You stole the jetpack, quickly take it to the place on the map.");
            
            
DestroyPickup(Jetpack);
            
SetTimer("StealAgain"1200000false);
            
            
            for(new 
0GetPlayerPoolSize(); <= ti++)
            {
                if(
gTeam[i] == C1)
                {
                    
GameTextForPlayer(i,"~b~Cops ~N~~W~intruder stole the ~N~~R~jetpack~W~ ~N~stop him immediately!"20004); 
                }
            }
        }
        return 
1;
    }
    return 
1;

I didn't find any real error to be honest... when do you crash exactly? When you get into the pickup?

PD: that's true, use type 3 instead of type 1.
Reply
#6

Quote:

(1326) : error 017: undefined symbol "LeavingCAPZONE"
(1495) : error 017: undefined symbol "LeavingCAPZONE"
(1574) : error 017: undefined symbol "LeavingCAPZONE"
(11160) : warning 219: local variable "color" shadows a variable at a preceding level
(11347) : warning 219: local variable "color" shadows a variable at a preceding level
(11359) : warning 219: local variable "color" shadows a variable at a preceding level
(12756) : error 029: invalid expression, assumed zero
(12756) : error 004: function "OnPlayerEnterDynamicCP" is not implemented
(12757) : error 029: invalid expression, assumed zero
(12757) : error 004: function "OnPlayerEnterDynamicCP" is not implemented
(12759) : error 017: undefined symbol "checkpointid"
(12766) : error 017: undefined symbol "ActiveCAPZONE"
(12769) : error 017: undefined symbol "CaptureZoneMessage"
(12774) : error 017: undefined symbol "checkpointid"
(12781) : error 017: undefined symbol "ActiveSNAKE"
(12784) : error 017: undefined symbol "CaptureZoneMessage"
(12787) : error 017: undefined symbol "checkpointid"
(12794) : error 017: undefined symbol "ActiveOLD"
(12797) : error 017: undefined symbol "CaptureZoneMessage"
(12800) : error 017: undefined symbol "checkpointid"
(12807) : error 017: undefined symbol "ActiveFactory"
(12810) : error 017: undefined symbol "CaptureZoneMessage"
(12813) : error 017: undefined symbol "checkpointid"
(12820) : error 017: undefined symbol "ActiveTown"
(12823) : error 017: undefined symbol "CaptureZoneMessage"
(1282 : warning 225: unreachable code
(1282 : error 029: invalid expression, assumed zero
(1282 : error 004: function "OnPlayerLeaveDynamicCP" is not implemented
(12829) : error 029: invalid expression, assumed zero
(12829) : error 004: function "OnPlayerLeaveDynamicCP" is not implemented

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

problem is with }
Reply
#7

Those errors are not related to the script you gave us dude...
Reply
#8

I didnt remove any } i just remove DestroyPickup(Jetpack);

and i change the pickup type from 1 to 3.
Reply
#9

Quote:
Originally Posted by [DOG]irinel1996
Посмотреть сообщение
Give a try:
PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == CP1)
    {
        
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Briefcase""Health - 5000$\nArmour - 10000$""Select""Cancel");
        return 
1;
    }
    if(
pickupid == TP)
    {
        
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Briefcase""Health - 5000$\nArmour - 10000$""Select""Cancel");
        return 
1;
    }
    if(
pickupid == TP1)
    {
        
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Briefcase""Health - 5000$\nArmour - 10000$""Select""Cancel");
        return 
1;
    }
    if(
pickupid == health)
    {
        if(
GetPlayerMoney(playerid) < 10000)
        {
            
SendClientMessage(playerid,COLOR_RED,"You don't have enough money to buy this!");
            return 
1;
        }
        
SetPlayerHealth(playerid100.0);
        
GivePlayerMoney(playerid, -10000);
        
SendClientMessage(playerid808080"You're successfully healed for 10000$");
        return 
1;
    }
    if(
pickupid == Jetpack)
    {
        if(
gTeam[playerid] == C1)
        {
            return 
1;
        }
        else
        {
            
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USEJETPACK);
            
SetPlayerMapIcon(playeridAmmu, -396.32052236.051342.4297200MAPICON_GLOBAL);
            
SendClientMessage(playerid,-1,"{FF0000}[JETPACK]{ffffff}You stole the jetpack, quickly take it to the place on the map.");
            
            
DestroyPickup(Jetpack);
            
SetTimer("StealAgain"1200000false);
            
            
            for(new 
0GetPlayerPoolSize(); <= ti++)
            {
                if(
gTeam[i] == C1)
                {
                    
GameTextForPlayer(i,"~b~Cops ~N~~W~intruder stole the ~N~~R~jetpack~W~ ~N~stop him immediately!");
                }
            }
        }
        return 
1;
    } 
I didn't find any real error to be honest... when do you crash exactly? When you get into the pickup?

PD: that's true, use type 3 instead of type 1.
when i put this i got 26 errors ?
Reply
#10

Quote:
Originally Posted by kyriakos587
Посмотреть сообщение
I didnt remove any } i just remove DestroyPickup(Jetpack);

and i change the pickup type from 1 to 3.
Actually, he wants to remove it, avoiding other players to get the Jetpack while the pickup is created again.

ON TOPIC: those errors are not caused by this script, be serious.

Change
PHP код:
GameTextForPlayer(i,"~b~Cops ~N~~W~intruder stole the ~N~~R~jetpack~W~ ~N~stop him immediately!"); 
to
PHP код:
GameTextForPlayer(i,"~b~Cops ~N~~W~intruder stole the ~N~~R~jetpack~W~ ~N~stop him immediately!"20004); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)