public OnPlayerEnterCheckpoint(playerid)
{
if(Trash1)
{
Trash2 = SetPlayerCheckpoint(playerid,242.6356,-89.5200,1.5781,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash2)
{
Trash3 = SetPlayerCheckpoint(playerid,273.9276,-62.1197,1.5781,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash3)
{
Trash4 = SetPlayerCheckpoint(playerid,290.1207,-61.3583,1.5830,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash4)
{
Trash5 = SetPlayerCheckpoint(playerid,322.7198,-88.9753,1.5771,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash5)
{
Trash6 = SetPlayerCheckpoint(playerid,322.5689,-124.2119,1.6048,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash6)
{
Trash7 = SetPlayerCheckpoint(playerid,754.1161,-540.2138,16.3459,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash7)
{
Trash8 = SetPlayerCheckpoint(playerid,768.1290,-540.5839,16.3748,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash8)
{
Trash9 = SetPlayerCheckpoint(playerid,749.3525,-520.6990,16.3359,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash9)
{
Trash10 = SetPlayerCheckpoint(playerid,766.8730,-520.2621,16.3359,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash10)
{
Trash11 = SetPlayerCheckpoint(playerid,789.7007,-519.8392,16.3620,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash11)
{
Trash12 = SetPlayerCheckpoint(playerid,822.1182,-520.1325,16.3359,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash12)
{
Trash13 = SetPlayerCheckpoint(playerid,731.9541,-585.7091,16.3578,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash13)
{
Trash14 = SetPlayerCheckpoint(playerid,665.1755,-622.8512,16.3359,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash14)
{
Trash15 = SetPlayerCheckpoint(playerid,668.1423,-623.2781,16.3359,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash15)
{
Trash16 = SetPlayerCheckpoint(playerid,657.8483,-648.5065,16.3359,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
}
if(Trash16)
{
Trash17 = SetPlayerCheckpoint(playerid,35.1380,-284.3482,2.1188,7);
GotAll[playerid] = 1;
SendClientMessage(playerid,COLOR_YELLOW,"Good, you got all. Now go back to the industries and drop it off");
}
if(Trash17)
{
GotAll[playerid] = 0;
SendClientMessage(playerid,COLOR_YELLOW,"Nice, you got them all. You got $7000 for doing it.");
GivePlayerMoney(playerid,7000);
DisablePlayerCheckpoint(playerid);
}
return 1;
}
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
new Trash1 = SetPlayerCheckpoint(...,...,...,...);
new Trash1;
Trash1 = SetPlayerCheckpoint(playerid,X,Y,Z,Float:size);
Originally Posted by IntrozeN
What different would that be to:
pawn Код:
|
//Top of script.
new InMission[MAX_PLAYERS];
//OnPlayerConnect
InMission[playerid] = 0;
//In the mission start command
InMission[playerid] = 1;
//OnPlayerEnterCheckpoint
public OnPlayerEnterCheckpoint(playerid)
{
if(InMission[playerid] == 1)
{
SetPlayerCheckpoint(playerid,242.6356,-89.5200,1.5781,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
InMission[playerid]++;
}
if(InMission[playerid] == 2)
{
SetPlayerCheckpoint(playerid,273.9276,-62.1197,1.5781,3);
SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
InMission[playerid]++;
}
//and so on.....
return 1;
}
//When they finish
InMission[playerid]=0;
new gPlayerCheckpointStatus[MAX_PLAYERS];
enum
{
CP_None,
CP_Trash
}
new Float:TrashCords[][4] =
{
{242.6356,-89.5200,1.5781,3.0},
{273.9276,-62.1197,1.5781,3.0},
{290.1207,-61.3583,1.5830,3.0},
{322.7198,-88.9753,1.5771,3.0},
{322.5689,-124.2119,1.6048,3.0},
{754.1161,-540.2138,16.3459,3.0},
{768.1290,-540.5839,16.3748,3.0},
{749.3525,-520.6990,16.3359,3.0},
{766.8730,-520.2621,16.3359,3.0},
{789.7007,-519.8392,16.3620,3.0},
{822.1182,-520.1325,16.3359,3.0},
{731.9541,-585.7091,16.3578,3.0},
{665.1755,-622.8512,16.3359,3.0},
{668.1423,-623.2781,16.3359,3.0},
{657.8483,-648.5065,16.3359,3.0},
{35.1380,-284.3482,2.1188,7.0}
}, PlayerTrashCounter[MAX_PLAYERS];
#define SetPlayerCheckpointEx(%0,%1,%2) gPlayerCheckpointStatus[%1] = %0, SetPlayerCheckpoint(%1, %2)
//just to make it easier to use
//Where you set the first checkpoint - command - spawn - or so
SetPlayerCheckpointEx(CP_Trash, playerid, TrashCords[0][0], TrashCords[0][1], TrashCords[0][2], TrashCords[0][3]);
//sets a checkpoint with the first cordinates - 242.6356,-89.5200,1.5781,3.0
public OnPlayerEnterCheckpoint(playerid)
{
switch(gPlayerCheckpointStatus[playerid])
{
case CP_Trash:
{
DisablePlayerCheckpoint(playerid);
if(++PlayerTrashCounter[playerid] == sizeof TrashCords)
{
SendClientMessage(playerid,COLOR_YELLOW,"Nice, you got them all. You got $7000 for doing it.");
GivePlayerMoney(playerid, 7000);
PlayerTrashCounter[playerid] = 0;
return true;
}
else if(PlayerTrashCounter[playerid] == sizeof TrashCords - 1)
SendClientMessage(playerid,COLOR_YELLOW,"Good, you got all. Now go back to the industries and drop it off");
else SendClientMessage(playerid,COLOR_YELLOW,"Good, now pickup next");
SetPlayerCheckpoint(playerid,
TrashCords[PlayerTrashCounter[playerid]][0],
TrashCords[PlayerTrashCounter[playerid]][1],
TrashCords[PlayerTrashCounter[playerid]][2],
TrashCords[PlayerTrashCounter[playerid]][3]);
}
default: DisablePlayerCheckpoint(playerid);
}
return 1;
}
Originally Posted by CrαcK
SetPlayerCheckpoint does not return an ID.
Workaround - using a streamer. |
Originally Posted by CrαcK
SetPlayerCheckpoint does not return an ID.
Workaround - using a streamer. |