Jump to content

mai multe checkpoint uri


AlexCelTare

Recommended Posts

Salut imi poate spune cineva cum fac atunci cand un player intra intr-un checkpoint, sa ii dea alt checkpoint si tot asa?

 

Eu am facut asa:
Dar habar nu am cum sa fac mai multe checkpointuri dupa ce intra intr-unul

 

new bool:onCheck[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
    if (strcmp("/startmission", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2333.1101,-1072.5065,1049.0234))
        {
        SetPlayerCheckpoint(playerid, -2130.9629,-2061.5767,63.3069, 3.0);
        onCheck[playerid] = true;
        }
        return 1;
    }

 

public OnPlayerEnterCheckpoint(playerid)
{
    if(onCheck[playerid]) // if it's true
    {
        GivePlayerMoney(playerid, 10);
        GameTextForPlayer(playerid,"~g~Mission 1 : Discover Dealership Completed!\nAnd Got +10$",3000,4);
        DisablePlayerCheckpoint(playerid);
        onCheck[playerid] = false;
    }

Edited by AlexCelTare
Link to comment
Share on other sites

poti face in felul urmator,

 

new Checkpoint[MAX_PLAYERS];


public OnPlayerCommandText(playerid, cmdtext[])
    if (strcmp("/startmission", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2333.1101,-1072.5065,1049.0234))
        {
        SetPlayerCheckpoint(playerid, -2130.9629,-2061.5767,63.3069, 3.0);
        Checkpoint[playerid] = 1;
        }
        return 1;
    }

public OnPlayerEnterCheckpoint(playerid)
{
    if(Checkpoint[playerid] == 1) // 
    {
        GivePlayerMoney(playerid, 10);
        GameTextForPlayer(playerid,"~g~Mission 1 : Discover Dealership Completed!\nAnd Got +10$",3000,4);
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, coordonatele tale, size);
        Checkpoint[playerid]++;
    }
    if(Checkpoint[playerid] == 2)
    {
    	continui comanda de aici.
    }
    return true;
}

 

Link to comment
Share on other sites

4 hours ago, hanako said:

poti face in felul urmator,

 

new Checkpoint[MAX_PLAYERS];


public OnPlayerCommandText(playerid, cmdtext[])
    if (strcmp("/startmission", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2333.1101,-1072.5065,1049.0234))
        {
        SetPlayerCheckpoint(playerid, -2130.9629,-2061.5767,63.3069, 3.0);
        Checkpoint[playerid] = 1;
        }
        return 1;
    }

public OnPlayerEnterCheckpoint(playerid)
{
    if(Checkpoint[playerid] == 1) // 
    {
        GivePlayerMoney(playerid, 10);
        GameTextForPlayer(playerid,"~g~Mission 1 : Discover Dealership Completed!\nAnd Got +10$",3000,4);
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, coordonatele tale, size);
        Checkpoint[playerid]++;
    }
    if(Checkpoint[playerid] == 2)
    {
    	continui comanda de aici.
    }
    return true;
}

 

nu imi merge, are vreo treaba functia new bool:onCheck[MAX_PLAYERS];?
aia am folosit-o pt un alt checkpoint la o alta comanda

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.