How to save random mission?
#6

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
So basically it's just like the code you gave us, but when the mission ends, you must do this:
pawn Код:
// This is where he ends the mission
new string[256];
format(string, sizeof(string), "%s has delivered %s!", GetPlayerName[playerid], MisLocations[MisRand][LoadName]);
SendClientMessageToAll(COLOR_WHITE, string);
I hope this is what you mean, else we need more explanation please
Код:
stock CheckpointEntered(playerid)
{
	new string[300];
    new vID = GetPlayerVehicleID(playerid);//Explained earlier
    if(!IsTrailerAttachedToVehicle(vID)) return SendClientMessage(playerid, COLOR_WHITE, "You need a trailer to unload!");//This line checks wether the player has a trailer attached to their truck.
    if(T_OnMission[playerid] == 1)//checks the players mission status
    {
        DisablePlayerCheckpoint(playerid);//disables the checkpoint
        SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);//creates the new checkpoint from the saved positions we made earlier
        SendClientMessage(playerid, COLOR_WHITE, "Loaded. Please head to the second checkpoint!");//sends message
        T_OnMission[playerid] = 2;//sets the players mission status
    }
    else if(T_OnMission[playerid] == 2)//checks the mission status of the player
    {
		if(iPay[playerid] < 10001){
		iScore[playerid] = 1;
		}
		else if(iPay[playerid] < 20001){
		iScore[playerid] = 2;
		}
		else if(iPay[playerid] > 20000){
		iScore[playerid] = 3;
		}
		format(string,sizeof(string),"Well done. You have completed your mission and earned %d$ and %d score.",iPay[playerid]*5,iScore[playerid]);
		TextDrawSetString(Textdraw0[playerid],"       You are currently not on mission. Use /work to start working.");
        GivePlayerMoney(playerid,iPay[playerid]*5);
        SendClientMessage(playerid, COLOR_YELLOW, string);
		new string2[256],name[30];
		GetPlayerName(playerid,name,sizeof(name));
		format(string2, sizeof(string2), "%s has delivered %s!", name, MisLocations[MisRand][LoadName]); //line 296
		SendClientMessageToAll(COLOR_YELLOW, string2);
        DisablePlayerCheckpoint(playerid);//disables the checkpoint
        T_OnMission[playerid] = 0;
        SetPlayerScore(playerid, GetPlayerScore(playerid)+iScore[playerid]);//gives the player 2 score
		new INI:File = INI_Open(UserPath(playerid));
    	INI_SetTag(File,"data");
  	  	INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    	INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
    	INI_WriteInt(File,"Score",GetPlayerScore(playerid));
    	INI_Close(File);
    }
    return 1;
}
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(296) : error 017: undefined symbol "MisRand"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Messages In This Thread
How to save random mission? - by wumpyc - 25.07.2013, 23:28
Re: How to save random mission? - by wumpyc - 26.07.2013, 00:54
Re: How to save random mission? - by wumpyc - 26.07.2013, 09:28
Re: How to save random mission? - by wumpyc - 27.07.2013, 10:42
Re: How to save random mission? - by JimmyCh - 27.07.2013, 10:57
Re: How to save random mission? - by wumpyc - 27.07.2013, 11:11
Re: How to save random mission? - by JimmyCh - 27.07.2013, 12:08
Re: How to save random mission? - by wumpyc - 27.07.2013, 13:31
Re: How to save random mission? - by kartik - 27.07.2013, 14:00
Re: How to save random mission? - by wumpyc - 27.07.2013, 16:11

Forum Jump:


Users browsing this thread: 1 Guest(s)