Command problem.
#1

Hey guys i have a problem with my command for my pizza boy job FS.

The problem is that when i type: /deliverpizza in-game nothing happens.(I don't have any pawno errors or warnings)

Here are the random checkpoints:
pawn Код:
new Float:RandomCheckpoint[][4] =
{
    {2362.9297,-1643.3599,14.3082, 10.0},
    {2523.2732,-1679.4453,15.4970, 10.0},
    {2178.5088,-1660.3746,14.9678, 10.0}
};
This is the command i have problem with, it's the actual command to start delivering pizzas:
pawn Код:
CMD:deliverpizza(playerid, params[])
{
    if(PizzaBoy[playerid] == 1 && IsPlayerInRangeOfPoint(playerid, 10.0, 2124.5547,-1803.9019,13.5547))
    {
    new rand = random(sizeof(RandomCheckpoint));
    SetPlayerCheckpoint(playerid, RandomCheckpoint[rand][0], RandomCheckpoint[rand][1], RandomCheckpoint[rand][2],3);
    } else {
        if (GetPVarType(playerid, "Delivering"))
        SendClientMessage(playerid, COLOR_LIGHTRED, "You are already delivering pizzas !");
    }
    return 1;
}
Reply
#2

The coords of IsPlayerInRangeOfPoint are not right, make sure you get the right x y z of the place.
Reply
#3

Good.. i fixed it but i have a new problem now.. when i walk into a checkpoint nothing of what i stated on OnPlayerEnterCheckpoint is happening:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if (IsPlayerInRangeOfPoint(playerid, 1.0, 2362.9297,-1643.3599,14.3082)) //Checkpoint 1
    {
        GivePlayerMoney(playerid, 2489);
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, COLOR_LIGHTRED, "You have delivered the pizza before it went cold, go and get more !");
        DeletePVar(playerid, "Delivering");
    }
    else if (IsPlayerInRangeOfPoint(playerid, 1.0,2523.2732,-1679.4453,15.4970)) //Checkpoint 2
    {
        GivePlayerMoney(playerid, 3000);
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, COLOR_LIGHTRED, "You have delivered the pizza before it went cold, go and get more !");
        DeletePVar(playerid, "Delivering");
    }
    else if (IsPlayerInRangeOfPoint(playerid, 1.0, 2178.5088,-1660.3746,14.9678)) //Checkpoint 3
    {
        GivePlayerMoney(playerid, 1258);
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, COLOR_LIGHTRED, "You have delivered the pizza before it went cold, go and get more !");
        DeletePVar(playerid, "Delivering");
    }
    return 1;
}
Any idea why is that happening ?
Reply
#4

Same, check the coords
Try with higher radiance to just make sure they work
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if (IsPlayerInRangeOfPoint(playerid, 5.0, 2362.9297,-1643.3599,14.3082)) //Checkpoint 1
    {
        GivePlayerMoney(playerid, 2489);
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, COLOR_LIGHTRED, "You have delivered the pizza before it went cold, go and get more !");
        DeletePVar(playerid, "Delivering");
    }
    else if (IsPlayerInRangeOfPoint(playerid, 5.0,2523.2732,-1679.4453,15.4970)) //Checkpoint 2
    {
        GivePlayerMoney(playerid, 3000);
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, COLOR_LIGHTRED, "You have delivered the pizza before it went cold, go and get more !");
        DeletePVar(playerid, "Delivering");
    }
    else if (IsPlayerInRangeOfPoint(playerid, 5.0, 2178.5088,-1660.3746,14.9678)) //Checkpoint 3
    {
        GivePlayerMoney(playerid, 1258);
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, COLOR_LIGHTRED, "You have delivered the pizza before it went cold, go and get more !");
        DeletePVar(playerid, "Delivering");
    }
    return 1;
}
Reply
#5

Done, thanks mate. I'm releasing the FS right away ! I added your credits inside for helping me fix some stuff.
+reped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)