Pawn Compiler Library Crash
#1

i added some lines to my script to make players spawn at hospital after death but i cant compile it because it makes my pawno crash... why? what did i do wrong? (lines i added are below)


pawn Код:
new dead[MAX_PLAYERS], respawntimer; //top of script
pawn Код:
public OnPlayerConnect(playerid)

dead[playerid] = 0;

public OnPlayerSpawn(playerid)
{
    if(dead[playerid] == 1)
    {
        SetPlayerPos(-221.059051,1408.984008,27.773437); //hospital pos
        SetPlayerInterior(playerid,18)
        ApplyAnimation(playerid,"MEDIC","CPR",1.1,1,0,0,1,30000,1);//animation
        respawntimer = SetTimer("respawned",60000,false);//1 minute in the hospital
    }
    else
    {
        SetPlayerPos(2034.1534,-1402.6010,17.2946); //your spawn locations
        return 1;
    }
    return 1;
}

    public OnPlayerDeath(playerid, killerid, reason)
    {
    SetPlayerPos(playerid,-221.059051,1408.984008,27.773437);///sets the player who dies to this position
    return 1;//ensure return 1; is in line like how i have it
    }


    forward respawned(playerid); //anywhere
    public respawned(playerid) //anywhere
    {
        SetPlayerPos(2034.1534,-1402.6010,17.2946); //your spawn location
        SendClientMessage(playerid,-1,"Recovered!");
           dead[playerid] = 0;
            KillTimer(respawntimer);
        return 1;
}
Reply
#2

anyone?
Reply
#3

you epic fail in some stuffs.

here it is the correct one

pawn Код:
new dead[MAX_PLAYERS], respawntimer; //top of script

public OnPlayerConnect(playerid)

dead[playerid] = 0;

public OnPlayerSpawn(playerid)
{
    if(dead[playerid] == 1)
    {
        SetPlayerPos(playerid, -221.059051,1408.984008,27.773437); //hospital pos
        SetPlayerInterior(playerid,18);
        ApplyAnimation(playerid,"MEDIC","CPR",1.1,1,0,0,1,30000,1);//animation
        respawntimer = SetTimerEx("respawned",60000,false, "i", playerid);//1 minute in the hospital
    }
    else
    {
        SetPlayerPos(playerid, 2034.1534,-1402.6010,17.2946); //your spawn locations
        return 1;
    }
    return 1;
}

    public OnPlayerDeath(playerid, killerid, reason)
    {
    SetPlayerPos(playerid,-221.059051,1408.984008,27.773437);///sets the player who dies to this position
    return 1;//ensure return 1; is in line like how i have it
    }


forward respawned(playerid); //anywhere
public respawned(playerid) //anywhere
{
    SetPlayerPos(playerid, 2034.1534,-1402.6010,17.2946); //your spawn location
    SendClientMessage(playerid,-1,"Recovered!");
    dead[playerid] = 0;
    KillTimer(respawntimer);
    return 1;
}
Reply
#4

pawno still crashes when i try to compile, so i dont know whats wrong....
Reply
#5

You didn't open or close the brackets for this line:

pawn Код:
public OnPlayerConnect(playerid)
You can either remove it, or open and close the brackets like so:

pawn Код:
public OnPlayerConnect(playerid) {
   return 1; // for the sake of consistency
}
Reply
#6

pawn Код:
new dead[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    dead[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(dead[playerid] == 1)
    {
        SetPlayerPos(playerid, -221.059051,1408.984008,27.773437); //hospital pos
        SetPlayerInterior(playerid,18);
        ApplyAnimation(playerid,"MEDIC","CPR",1.1,1,0,0,1,30000,1);//animation
        SetTimerEx("respawned",60000,false, "i", playerid);//1 minute in the hospital
    }
    else
    {
        SetPlayerPos(playerid, 2034.1534,-1402.6010,17.2946); //your spawn locations
        return 1;
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    dead[playerid] = 1;
    return 1;//ensure return 1; is in line like how i have it
}

forward respawned(playerid); //anywhere
public respawned(playerid) //anywhere
{
    SetPlayerPos(playerid, 2034.1534,-1402.6010,17.2946); //your spawn location
    SendClientMessage(playerid,-1,"Recovered!");
    dead[playerid] = 0;
    return 1;
}
Reply
#7

i dont know what it is but no matter what i do my pawno still crashes when i try to compile, it never used to.
Reply
#8

Quote:
Originally Posted by Ben_Hatfield
Посмотреть сообщение
i dont know what it is but no matter what i do my pawno still crashes when i try to compile, it never used to.
i'm facing a similar problem of the pawn compiler library crashing now.
have you found the resolution yet?
Reply
#9

Quote:
Originally Posted by RayDcosta
Посмотреть сообщение
i'm facing a similar problem of the pawn compiler library crashing now.
have you found the resolution yet?
it crashes because of the brackets placed wrongly.
Reply
#10

Quote:
Originally Posted by RayDcosta
Посмотреть сообщение
i'm facing a similar problem of the pawn compiler library crashing now.
have you found the resolution yet?
Didn't you noticed that you've bump a thread that was last posted on 2012 -_-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)