#include <a_samp>
new YourJobName[256];
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == YOUR VEHICLE ID) // Will enter in checkpoint with this Car ID !
{
if(YourJobName[playerid] == 1) // First checkpoint
{
YourJobName[playerid] = 2; // When he enter in this checkpoint will show another one
SetPlayerCheckpoint(playerid,-488.9691,-1454.4095,13.6985,10); // Checkpoint position
return 1;
}
if(YourJobName[playerid] == 2) // Third
{
YourJobName[playerid] = 3; // When he enter in this checkpoint will show another one
SetPlayerCheckpoint(playerid,-491.1559,-1590.0781,6.0986,10); // Checkpoint position
return 1;
}
if(YourJobName[playerid] == 3) // Third
{
YourJobName[playerid] = 4; // When he enter in this checkpoint will show another one
SetPlayerCheckpoint(playerid,-517.1489,-1494.8715,10.6554,10); // Checkpoint position
return 1;
}
if(YourJobName[playerid] == 4) // Fourth
{
YourJobName[playerid] = 5; // When he enter in this checkpoint will show another one
SetPlayerCheckpoint(playerid,-537.1957,-1495.2427,9.5398,10); // Checkpoint position
return 1;
}
if(YourJobName[playerid] == 5) // Fifth
{
YourJobName[playerid] = 6; // When he enter in this checkpoint will show another one
SetPlayerCheckpoint(playerid,-538.4468,-1594.6807,7.9598,10); // Checkpoint position
return 1;
}
if(YourJobName[playerid] == 6) // Six
{
YourJobName[playerid] = 7; // When he enter in this checkpoint will show another one
SetPlayerCheckpoint(playerid,-562.2611,-1505.3055,8.7389,10); // Checkpoint position
return 1;
}
if(YourJobName[playerid] == 7) // Last
{
YourJobName[playerid] = 0; // He finished, so he got money and disable all checkpoints
DisablePlayerCheckpoint(playerid); // Disable checkpoints
GivePlayerMoney(playerid,Money); // Give him money
}
}
return 1;
}
pawn Код:
- And that "i" red it's a pick-up . Pick-up id: 1239 ! - More details see at below links : http://weedarr.wikidot.com/pickups https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup |
I'm sorry, I don't know your enums, and jobs information. If you could give me, I will help you.
|
enum pInfo
{
// Stored Variables
pKills,
p9mm,
pDeaths,
pID,
pUsername[MAX_PLAYER_NAME],
pAge,
pGender,
pRegistered,
pMember,
pRank,
pLeader,
pIP[16],
pBanned,
pBanReason[64],
pBanExpiry,
pNMute,
pRMute,
pAJailed,
pAJailTime,
pAdminDuty,
pAdminLevel,
pSecondaryTask,
pMoney,
Float:pPositionX,
Float:pPositionY,
Float:pPositionZ,
Float:pFacingAngle,
pInterior,
pVirtualWorld,
pSkin,
Float:pHealth,
Float:pArmour,
// Unstored Variables
pReport[128],
pTogNewbie,
pLastUpdate,
PlayerAnimLibsPreloaded,
gPlayerUsingLoopingAnim,
CurrentDialog,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
enum dInfo
{
Float:dExteriorX,
Float:dExteriorY,
Float:dExteriorZ,
Float:dExteriorAngle,
dExteriorInt,
dExteriorVir,
Float:dInteriorX,
Float:dInteriorY,
Float:dInteriorZ,
Float:dInteriorAngle,
dInteriorInt,
dInteriorVir,
dName[64],
dPickup,
Text3D:dDynamicText
}
new DoorInfo[MAX_DOORS][dInfo];
enum gInfo
{
gName[32],
gType,
gRank0[32],
gRank1[32],
gRank2[32],
gRank3[32],
gRank4[32],
gRank5[32],
gRank6[32]
};
#include <a_samp>
#include <zcmd>
#define MAX_JOBS 2 // Max Jobs
#define YourJobName 1 // Your Job Name
new wJob[MAX_PLAYERS];
// Get Job command
CMD:getjob(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, RANGE, X, Y, Z)) // Replace RANGE = Distance when he can use, and X,Y,Z with your pick-up coordinates
wJob[playerid] = 1; // 1 = YourJobName from defines !
SendClientMessage(playerid, -1, "{FF0000}[INFO]: {15FF00}You have chose your job."); // He will get a job !
return 1;
}
// For making a command only for that job :
CMD:CommandName(playerid, params[])
{
if(wJob[playerid] != 1) //Number "1" is your job name.
return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have this job"); // Get a message he haven't that job !
SendClientMessage(playerid,-1,"Your job command Text or code"); // If he have that job
return 1;
}
// For Quit Job (You don't have any job)
CMD:quitjob(playerid, params[])
{
wJob[playerid] = 0; //Now you don't have any job !
SendClientMessage(playerid,0xAFAFAFAA,"Now you're unemployed"); // Text
return 1;
}
pawn Код:
http://www.solidfiles.com/d/d20f/zcmd.inc - Hope I helped you. A good day ! - P.S: Sorry I writed so hard, I didn't see your comments, I was working . ![]() |
//Start of jobs
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 531)
{
if(ExJob[playerid] == 1){
ExJob[playerid] = 2;
SetPlayerCheckpoint(playerid,50.2074,-86.3620,0.6094,10);
SendClientMessage(playerid,COLOR_YELLOW,"* Please go to the next mark, and you'll be payed!");
return 1;
}
if(ExJob[playerid] == 2){
ExJob[playerid] = 3;
SetPlayerCheckpoint(playerid,42.8746,-114.5679,0.6169,10);
return 1;
}
if(ExJob[playerid] == 3){
ExJob[playerid] = 4;
SetPlayerCheckpoint(playerid,42.8746,-114.5679,0.6169,10);
return 1;
}
if(ExJob[playerid] == 4){
ExJob[playerid] = 5;
SetPlayerCheckpoint(playerid,33.0193,-118.6128,0.6169,10);
return 1;
}
if(ExJob[playerid] == 5){
ExJob[playerid] = 6;
SetPlayerCheckpoint(playerid,42.6236,-71.0327,0.6094,10);
return 1;
}
if(ExJob[playerid] == 6){
ExJob[playerid] = 7;
SetPlayerCheckpoint(playerid,37.0597,-61.5438,1.5049,10);
return 1;
}
if(ExJob[playerid] == 7){
ExJob[playerid] = 8;
SetPlayerCheckpoint(playerid,17.9072,-119.0836,0.6094,10);
return 1;
}
if(ExJob[playerid] == 8){
ExJob[playerid] = 9;
SetPlayerCheckpoint(playerid,31.6652,-50.3610,2.5574,10);
return 1;
}
if(ExJob[playerid] == 8){
ExJob[playerid] = 9;
SetPlayerCheckpoint(playerid,9.0930,-116.7551,0.6390,10);
return 1;
}
if(ExJob[playerid] == 9){
ExJob[playerid] = 0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_YELLOW,"* You have recieved $300 for your work!");
GivePlayerMoney(playerid,150);
}
}
return 1;
}
// Get Job command
CMD:getjob(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 4.0,-46.5548,-108.5900,3.1172)) // Replace RANGE = Distance when he can use, and X,Y,Z with your pick-up coordinates
wJob[playerid] = 1; // 1 = YourJobName from defines !
SendClientMessage(playerid, -1, "{FF0000}[INFO]: {15FF00}You have chose your job."); // He will get a job !
return 1;
}
// For making a command only for that job :
CMD:CommandName(playerid, params[])
{
if(wJob[playerid] != 1) //Number "1" is your job name.
return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have this job"); // Get a message he haven't that job !
SendClientMessage(playerid,-1,"Your job command Text or code"); // If he have that job
return 1;
}
// For Quit Job (You don't have any job)
CMD:quitjob(playerid, params[])
{
wJob[playerid] = 0; //Now you don't have any job !
SendClientMessage(playerid,0xAFAFAFAA,"Now you're unemployed"); // Text
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, RANGE, X, Y, Z))