19.12.2010, 23:46
hello, how can i make a mission? like drive a truck to a checkpoint.
// Top of your script
new
Mission [ MAX_PLAYERS ];
// OnPlayerConnect / Disconnect
Mission [ playerid ] = 0;
// Bottom of script
// NOTE: I use ZCMD
COMMAND:startmission ( playerid, params [ ] )
{
if ( Mission [ playerid ] == 0 )
{
if ( IsPlayerInVehicle ( playerid, * ) ) // * = The vehicle ID
{
Mission [ playerid ] = 1;
SetPlayerCheckpoint ( playerid, x, y, z );
}
else
{
// message error like " you are not in a truck
}
}
else
{
// message error like " you are already in a mission
}
}
// OnPlayerEnterCheckpoint
if ( Mission [ playerid ] == 1 )
{
// REWARD
Mission [ playerid ] = 0;
return 1;
}