Jump to content

Recommended Posts

Posted (edited)

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
Posted

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;
}

 

Posted
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.