Checkpoint after checkpoint - Please help if you can
#1

I was wondering how to create a another checkpoint after I leave the first checkpoint.

Allright.. first I active the checkpoint with a command:

pawn Код:
if (!strcmp(cmdtext , "/work" , true))
    {
        SetPlayerCheckpoint(playerid, 1280.0111161369013, 2530.9914920195056, -0.2432, 3.0);
        SendClientMessage(playerid, 0x489048FF , "Get the drug package from the crackhouse");
        return 1;
    }

That's was the command to activate the checkpoint then:

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SendClientMessage(playerid , 0x489048FF , "You have recieved the drug package");
    SendClientMessage(playerid , 0x489048FF , "--------------------------------------------------------------");
    SendClientMessage(playerid , 0x489048FF , "Deliever the package to the checkpoint to recieve your payment");
    return 1;
}
Okay.. next I leave the chekcpoint:

pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
    SetPlayerCheckpoint(playerid, -81.80088525521978, 1222.35923886073, -0.2432, 3.0);
    return 1;
}
And this is the problem --- what am I supposed to do now?
Reply
#2

Is this for race or?
Reply
#3

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
Is this for race or?
Nope. For a job where you go to your first checkpoint --> it creates another checkpoint and when you enter the second checkpoint --> You get money. I could basically do it but I just don't know where to script the second checkpoint since there are only one OnPlayerEnterCheckpoint and ...LeaveCheckpoint
Reply
#4

Have you tried to put other checkpoint while he OnPlayerEnterCheckpoint on the first checkpoint?
Reply
#5

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
Have you tried to put other checkpoint while he OnPlayerEnterCheckpoint on the first checkpoint?
I'll give it a try but...(this is so freaking hard to explain) I need to have two checkpoints and the problem is that I don't know where I must script the other checkpoint since there is already a function in the OnPlayerEnterCheckPoint so do I don't know how I make pawno recognize which checkpoint is which.

You didn't propably understand that but if you have some kind of a alternative for this whole system, I'd be glad to hear it.

Thanks
Reply
#6

pawn Код:
new Job[256]; //top of the scripts

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/job", cmdtext, true, 10) == 0)
    {
        Job[playerid] = 1;
        return 1;
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if(Job[playerid] == 1)
    {
        Job[playerid] = 2;
        SetPlayerCheckpoint(playerid, X,Y,Z,1); // 2nd checkpoint coordinates
        // rewards for the first checkpoint...
        return 1;
    }
    if(Job[playerid] == 2)
    {
        Job[playerid] = 3;
        SetPlayerCheckpoint(playerid, X,Y,Z,1); // 3rd checkpoint coordinates
        // rewards for the seconds checkpoint...
        return 1;
    }
    // etc.. etc... etc.. etc.. etc.. etc.. etc.. etc..
    return 1;
}
I don't test the code but I think it's like that. (Feel free to correct me).
Reply
#7

Quote:
Originally Posted by Matnix
Посмотреть сообщение
pawn Код:
new Job[256]; //top of the scripts

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/job", cmdtext, true, 10) == 0)
    {
        Job[playerid] = 1;
        SetPlayerCheckpoint(playerid, X,Y,Z,1); // YOU NEED TO ADD FIRST CHECKPOINT
        return 1;
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if(Job[playerid] == 1)
    {
        Job[playerid] = 2;
        SetPlayerCheckpoint(playerid, X,Y,Z,1); // 2nd checkpoint coordinates
        // rewards for the first checkpoint...
        return 1;
    }
    if(Job[playerid] == 2)
    {
        Job[playerid] = 3;
        SetPlayerCheckpoint(playerid, X,Y,Z,1); // 3rd checkpoint coordinates
        // rewards for the seconds checkpoint...
        return 1;
    }
    // etc.. etc... etc.. etc.. etc.. etc.. etc.. etc..
    return 1;
}
I don't test the code but I think it's like that. (Feel free to correct me).
You need to add first check point on command.
Reply
#8

Quote:
Originally Posted by Matnix
Посмотреть сообщение
pawn Код:
new Job[256]; //top of the scripts

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/job", cmdtext, true, 10) == 0)
    {
        Job[playerid] = 1;
        return 1;
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if(Job[playerid] == 1)
    {
        Job[playerid] = 2;
        SetPlayerCheckpoint(playerid, X,Y,Z,1); // 2nd checkpoint coordinates
        // rewards for the first checkpoint...
        return 1;
    }
    if(Job[playerid] == 2)
    {
        Job[playerid] = 3;
        SetPlayerCheckpoint(playerid, X,Y,Z,1); // 3rd checkpoint coordinates
        // rewards for the seconds checkpoint...
        return 1;
    }
    // etc.. etc... etc.. etc.. etc.. etc.. etc.. etc..
    return 1;
}
I don't test the code but I think it's like that. (Feel free to correct me).
Thanks for your help. I'm just getting some errors here.

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(Job[playerid] == 1)
    {
    Job[playerid] = 2;
    SetPlayerCheckpoint(playerid, 1283.8518 , 2524.6912 , 10.8203 , 1);
    return 1;
    }
    if(Job[playerid] == 2)
    {
    Job[playerid] = 3;
    SetPlayerCheckpoint(playerid, 2215.0139 , 1431.6350 , 11.0547 , 1);
    return 1;
    }
    if(Job[playerid] == 3)
    {
    GivePlayerMoney(playerid , 1000);
    return 1;
}
And here is the error list:

pawn Код:
C:\Users\Sami\Desktop\SERVU\shit.pwn(103) : warning 217: loose indentation
C:\Users\Sami\Desktop\SERVU\shit.pwn(130) : warning 217: loose indentation
C:\Users\Sami\Desktop\SERVU\shit.pwn(168) : warning 217: loose indentation
C:\Users\Sami\Desktop\SERVU\shit.pwn(168) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(168) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(173) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(173) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(173) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(178) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(178) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(178) : error 004: function "OnPlayerLeaveRaceCheckpoint" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(183) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(183) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(183) : error 004: function "OnRconCommand" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(188) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(188) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(188) : error 004: function "OnPlayerRequestSpawn" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(193) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(193) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(193) : error 004: function "OnObjectMoved" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(198) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(198) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(198) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(203) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(203) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(203) : error 004: function "OnPlayerPickUpPickup" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(208) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(208) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(208) : error 004: function "OnVehicleMod" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(213) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(213) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(213) : error 004: function "OnVehiclePaintjob" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(218) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(218) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(218) : error 004: function "OnVehicleRespray" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(223) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(223) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(223) : error 004: function "OnPlayerSelectedMenuRow" is not implemented
C:\Users\Sami\Desktop\SERVU\shit.pwn(228) : warning 225: unreachable code
C:\Users\Sami\Desktop\SERVU\shit.pwn(228) : error 029: invalid expression, assumed zero
C:\Users\Sami\Desktop\SERVU\shit.pwn(228) : error 004: function "OnPlayerExitedMenu" is not implemented

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Reply
#9

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(Job[playerid] == 1)
    {
        Job[playerid] = 2;
        SetPlayerCheckpoint(playerid, 1283.8518 , 2524.6912 , 10.8203 , 1);
    }
    if(Job[playerid] == 2)
    {
        Job[playerid] = 3;
        SetPlayerCheckpoint(playerid, 2215.0139 , 1431.6350 , 11.0547 , 1);
    }
    if(Job[playerid] == 3)
    {
        GivePlayerMoney(playerid , 1000);
    } //MISSING BRACKET
    return 1;
}
Reply
#10

Yeah! it worked.

Huge thanks to both of you RedJohn and Matnix!
This was exactly what I was looking for.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)