Why not working?
#1

I made a mission system and it have no errors but its not working in the game
Код:
//~~~~~~~~~~~~~~~Pizza Missions By Tuntun~~~~~~~~~~~~~~~
//Do Not remove his credits!

#include <a_samp>
#include <zcmd>

new PizzaJob[300];

new IsPlayerInMission[MAX_PLAYERS];

public OnFilterScriptInit()
{
    CreateVehicle(448, 2098.7107, -1821.3761, 12.8967, 0.0000, -1, -1, 100);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp("/pwork", cmdtext, true))
	{
		new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
		if(IsPlayerInMission[playerid] >= 1)return SendClientMessage(playerid,-1,"You already have a mission!");
		if (pvehiclemodel == 448)
		{
			PizzaJob[playerid] = 1;
			SetPlayerCheckpoint(playerid, 2099.0190,-1806.6707,13.5551,3.5);
			SendClientMessage(playerid, -1,"~g~Info: ~w~Mission started You have to go at 2 houses! Please follow the check point!");
			GameTextForPlayer(playerid,"~w~Mission~g~Started!", 3000, 3);
			return 1;
		}
		SendClientMessage(playerid, -1,"You have to be on a pizza bike to start pizza boy mission!");
	}
	return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
	{
		SendClientMessage(playerid,-1,"Must use /pwork to start the mission");
	}
	return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
	{
		if(PizzaJob[playerid] == 1){
			PizzaJob[playerid] = 2;
			SetPlayerCheckpoint(playerid, 1936.2399,-1923.8591,13.5469, 3.5 );
			GameTextForPlayer(playerid,"~w~Mission ~g~ Started!", 3000, 3);
			return 1;
		}
		if(PizzaJob[playerid] == 2){
   		   	PizzaJob[playerid] = 3;
			SetPlayerCheckpoint(playerid,1921.4567,-1992.3204,13.5469, 3.5 );
			GameTextForPlayer(playerid,"~w~Go to Another House!", 3000, 3);
			return 1;
		}
		if(PizzaJob[playerid] == 3){
			PizzaJob[playerid] = 0;
			DisablePlayerCheckpoint(playerid);
			SendClientMessage(playerid, -1,"Info: Mission Completed! Earned 20,000$ & 5 score");
			GivePlayerMoney(playerid,20000);
			GameTextForPlayer(playerid,"~w~ Mission ~g~ Completed!", 3000, 3);
			SetPlayerScore(playerid,5);
		}
	}
	return 1;
}
CMD:pizza(playerid,params[])
{
	SetPlayerPos(playerid,2021.6563, -1810.7266, 18.6016);
	return 1;
}
Reply
#2

Use elseif
For the bottoms checks in the OnPlayerEnterCheckpoint
Reply
#3

Explain?
Reply
#4

Like this!
pawn Код:
if(PizzaJob[playerid] == 1){
            PizzaJob[playerid] = 2;
            SetPlayerCheckpoint(playerid, 1936.2399,-1923.8591,13.5469, 3.5 );
            GameTextForPlayer(playerid,"~w~Mission ~g~ Started!", 3000, 3);
            return 1;
        }
        else if(PizzaJob[playerid] == 2){
            PizzaJob[playerid] = 3;
            SetPlayerCheckpoint(playerid,1921.4567,-1992.3204,13.5469, 3.5 );
            GameTextForPlayer(playerid,"~w~Go to Another House!", 3000, 3);
            return 1;
        }
        else if(PizzaJob[playerid] == 3){
            PizzaJob[playerid] = 0;
            DisablePlayerCheckpoint(playerid);
            SendClientMessage(playerid, -1,"Info: Mission Completed! Earned 20,000$ & 5 score");
            GivePlayerMoney(playerid,20000);
            GameTextForPlayer(playerid,"~w~ Mission ~g~ Completed!", 3000, 3);
            SetPlayerScore(playerid,5);
        }
Reply
#5

Код:
D:\Trucking\filterscripts\pizza.pwn(63) : error 030: compound statement not closed at the end of file (started at line 43)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
    {
        if(PizzaJob[playerid] == 1){
            PizzaJob[playerid] = 2;
            SetPlayerCheckpoint(playerid, 1936.2399,-1923.8591,13.5469, 3.5 );
            GameTextForPlayer(playerid,"~w~Mission ~g~ Started!", 3000, 3);
            return 1;
        }
        else if(PizzaJob[playerid] == 2){
            PizzaJob[playerid] = 3;
            SetPlayerCheckpoint(playerid,1921.4567,-1992.3204,13.5469, 3.5 );
            GameTextForPlayer(playerid,"~w~Go to Another House!", 3000, 3);
            return 1;
        }
        else if(PizzaJob[playerid] == 3){
            PizzaJob[playerid] = 0;
            DisablePlayerCheckpoint(playerid);
            SendClientMessage(playerid, -1,"Info: Mission Completed! Earned 20,000$ & 5 score");
            GivePlayerMoney(playerid,20000);
            GameTextForPlayer(playerid,"~w~ Mission ~g~ Completed!", 3000, 3);
            SetPlayerScore(playerid,5);
        }
    }
    return 1;
}
And why are you using both ZCMD and onplayercommandtext.
Use 1. Maybe that's the problem.
Reply
#7

pawn Код:
public OnFilterScriptInit()
{
    CreateVehicle(448, 2098.7107, -1821.3761, 12.8967, 0.0000, -1, -1, 100);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/pwork", cmdtext, true))
    {
        new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
        if(IsPlayerInMission[playerid] >= 1) return SendClientMessage(playerid,-1,"You already have a mission!");
        if (pvehiclemodel == 448)
        {
            PizzaJob[playerid] = 1;
            SetPlayerCheckpoint(playerid, 2099.0190,-1806.6707,13.5551,3.5);
            SendClientMessage(playerid, -1,"~g~Info: ~w~Mission started You have to go at 2 houses! Please follow the check point!");
            GameTextForPlayer(playerid,"~w~Mission~g~Started!", 3000, 3);
            return 1;
        }
        SendClientMessage(playerid, -1,"You have to be on a pizza bike to start pizza boy mission!");
    }
    return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
    {
        SendClientMessage(playerid,-1,"Must use /pwork to start the mission");
    }
    return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
    {
        if(PizzaJob[playerid] == 1){ // When he enters the first checkpoint and pizzajob is 1, it should set another checkpoint and say "Go to another house", not "mission started", because it was already started by the command...
            PizzaJob[playerid] = 2;
            SetPlayerCheckpoint(playerid, 1936.2399,-1923.8591,13.5469, 3.5 );
            GameTextForPlayer(playerid,"~w~Go to Another House!", 3000, 3);
        }
        else if(PizzaJob[playerid] == 2){
            PizzaJob[playerid] = 0;
            DisablePlayerCheckpoint(playerid);
            SendClientMessage(playerid, -1,"Info: Mission Completed! Earned 20,000$ & 5 score");
            GivePlayerMoney(playerid,20000);
            GameTextForPlayer(playerid,"~w~ Mission ~g~ Completed!", 3000, 3);
            SetPlayerScore(playerid,GetPlayerScore(playerid)+5); // Edited here
            IsPlayerInMission[playerid] = 0; // Added this
        }
    }
    return 1;
}
CMD:pizza(playerid,params[])
{
    SetPlayerPos(playerid,2021.6563, -1810.7266, 18.6016);
    return 1;
}
Try now, it should work...
Reply
#8

Still not working... maybe because i have another job? i made my another job... its pilot... that why that job is not working? help..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)