03.11.2014, 19:46
One, why isn't this working properly? It's mean to spawn an info icon and when you're over it you type /getjob and it gives you the job, but you get get the job anywhere and the icon doesn't seem to spawn. Also, when I made checkpoints they aren't showing up on the map, why?
Code.
Also, how would I make it so that when someone joins the server their name appears in yellow and then it shows their IP next to it. Let me give an example.
Michael_J_Dillon has joined the server [IP: (IP HERE)]
Code.
pawn Код:
//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;
}
Michael_J_Dillon has joined the server [IP: (IP HERE)]