Samp server.exe closes when i enter a checkpoint
#9

here's my changed code in place of %s i used %d:
pawn Код:
if(Ccp[playerid] == 1) // This checks if our variable equals to 1, if so: it continues
    {
        DisablePlayerCheckpoint(playerid); // This makes sure that there will be a new checkpoint
        Ccp[playerid] = 2; // Changes the variable, so we can use it later again with OnPlayerEnterCheckpoint
        SetPlayerCheckpoint(playerid, -1874.0277,-1675.2848,21.7418, 3.0); // Creates a new checkpoint at a different position
        new rand = RandomEx(0,8);
        SendClientMessage(playerid, COLOR_WHITE, "You have loaded %d materials in your package, Proceed to next pickup.", rand);
    }
    else if(Ccp[playerid] == 2) // This checks if our variable equals to 1, if so: it continues
    {
        DisablePlayerCheckpoint(playerid); // This makes sure that there will be a new checkpoint
        Ccp[playerid] = 3; // Changes the variable, so we can use it later again with OnPlayerEnterCheckpoint
        SetPlayerCheckpoint(playerid, 2085.2393,-2092.6560,13.5309, 3.0); // Creates a new checkpoint at a different position
        new rand = RandomEx(0,13);
        SendClientMessage(playerid, COLOR_WHITE, "You have loaded %d materials in your package, Proceed to next pickup", rand);
    }
    else if(Ccp[playerid] == 3) // This checks if our variable equals to 1, if so: it continues
    {
        DisablePlayerCheckpoint(playerid); // This makes sure that there will be a new checkpoint
        Ccp[playerid] = 4; // Changes the variable, so we can use it later again with OnPlayerEnterCheckpoint
        SetPlayerCheckpoint(playerid, 1354.1035,481.0210,20.2016, 3.0); // Creates a new checkpoint at a different position
        new rand = RandomEx(0,13);
        SendClientMessage(playerid, COLOR_WHITE, "You have loaded %d materials in your package, Proceed to next pickup", rand);
    }
    else if(Ccp[playerid] == 4) // This checks if our variable equals to 1, if so: it continues
    {
        DisablePlayerCheckpoint(playerid); // This makes sure that there will be a new checkpoint
        Ccp[playerid] = 5; // Changes the variable, so we can use it later again with OnPlayerEnterCheckpoint
        SetPlayerCheckpoint(playerid, 2107.0288,-1887.4937,13.5410, 3.0); // Creates a new checkpoint at a different position
        new rand = RandomEx(0,13);
        SendClientMessage(playerid, COLOR_WHITE, "You have loaded %d materials in your package, Proceed to next pickup", rand);
    }
    else if(Ccp[playerid] == 5) // This checks if our variable equals to 1, if so: it continues
    {
        DisablePlayerCheckpoint(playerid); // This makes sure that there will be a new checkpoint
        Ccp[playerid] = 6; // Changes the variable, so we can use it later again with OnPlayerEnterCheckpoint
        SetPlayerCheckpoint(playerid, 2543.7610,-2389.5366,13.6344, 3.0); // Creates a new checkpoint at a different position
        SendClientMessage(playerid, COLOR_WHITE, "You have sucessfully compleated you delivery, Return to LA Docks to get paid");
    }
    else if(Ccp[playerid] == 6) // This checks if our variable equals to 1, if so: it continues
    {
        DisablePlayerCheckpoint(playerid); // This makes sure that there will be a new checkpoint
        Ccp[playerid] = 0; // Changes the variable, so we can use it later again with OnPlayerEnterCheckpoint
        //SetPlayerCheckpoint(playerid, 2543.7610,-2389.5366,13.6344, 3.0); // Creates a new checkpoint at a different position
        new cash = RandomEx(8000,40001);
        SendClientMessage(playerid, COLOR_WHITE, "You have sucessfully compleated you delivery,  LA Docks has paid you $%d and some mats Enjoy!", cash);
        GivePlayerMoney(playerid, cash);
    }
EDIT:How can i restrict this cmd only if player is in carid 499(warehouse truck)
Код:
CMD:loadmats(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
	if(IsPlayerInRangeOfPoint(playerid, 5.0, 2568.7224,-2419.9768,13.6341))
	{
	if(IsAWarehouseTruck(vehicleid))
	{
	if(PlayerInfo[playerid][pJob] != 4)
	{
		SendClientMessage(playerid, COLOR_WHITE, "You are not a Warehouse worker!");
	}
	else
	{
		SendClientMessage(playerid, COLOR_WHITE, "You have picked a material's package, Proceed to next pickup");
        SetPlayerCheckpoint(playerid, 2311.5037,-74.1533,26.4751, 3.0);
		Ccp[playerid] = 1;
 	}
 	}
	else SendClientMessage(playerid, COLOR_WHITE, "You need to be inside a Warehouse truck to pick a materials package!");
	}
	else SendClientMessage(playerid, COLOR_WHITE, "You are not at the package loading point!");
	return 1;
}
currently i use this code to specify IsAWarehouseTruck:
Код:
IsAWarehouseTruck(carid)
{
	if(carid == 499) return 1;
}
And it comes wth a warning that it should return a value!when i use this it says you are not in a warehouse truck even i am in carid 499?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)