Transforming onplayerentercheckpoint
#1

Hi. How can I change the checkpoint into IsPlayerInRangeOfPoint ? And make something which will tell player where to go

OR, what can I do to airdrop without chaning it's forwarding or making it command?


PHP код:
    if(GunoierJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid2741.6865,-1504.8694,30.90645.0);
        
AddSlotToInventoryWorld(playerid,"Sticla de Apa Plina",1);
        
SendClientMessage(playerid, -1"{FFCC33}Ai primit {FF0000}Sticla de Apa Plina {FFCC33}pentru primul transport al gunoiului!");
        
GunoierJob[playerid] = 2;
        return 
1;
    } 
Its a job system which you have to go into checkpoints, but instead of checkpoints I want to put IsPlayerInRangeOfPoint because every 15 minutes server forwards airdrop which creates new checkpoint.



PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
GunoierJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid2741.6865,-1504.8694,30.90645.0);
        
AddSlotToInventoryWorld(playerid,"Sticla de Apa Plina",1);
        
SendClientMessage(playerid, -1"{FFCC33}Ai primit {FF0000}Sticla de Apa Plina {FFCC33}pentru primul transport al gunoiului!");
        
GunoierJob[playerid] = 2;
        return 
1;
    }
    if(
GunoierJob[playerid] == 2)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid2703.7903,-1065.6555,69.82325.0);
        
GivePlayerMoney(playerid4321);
        
SendClientMessage(playerid, -1"{FFCC33}Ai primit {FF0000}4321 $ {FFCC33}pentru al doilea transport al gunoiului!");
        
GunoierJob[playerid] = 3;
        return 
1;
    }
    if(
GunoierJob[playerid] == 3)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid2257.4766,-1150.7429,27.34265.0);
        
GivePlayerMoney(playerid6311);
        
SendClientMessage(playerid, -1"{FFCC33}Ai primit {FF0000}6311 $ {FFCC33}pentru al treilea transport al gunoiului!");
        
GunoierJob[playerid] = 4;
        return 
1;
    }
    if(
GunoierJob[playerid] == 4)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid2390.6865,-1726.5602,14.04375.0);
        
GivePlayerMoney(playerid3954);
        
SendClientMessage(playerid, -1"{FFCC33}Ai primit {FF0000}3954 $ {FFCC33}pentru al patrulea transport al gunoiului!");
        
GunoierJob[playerid] = 5;
        return 
1;
    }
    if(
GunoierJob[playerid] == 5)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid2229.7378,-1977.7834,13.99285.0);
        
GivePlayerMoney(playerid9213);
        
SendClientMessage(playerid, -1"{FFCC33}Ai primit {FF0000}9213 $ {FFCC33}pentru ultimul transport al gunoiului!");
        
GunoierJob[playerid] = 6;
        return 
1;
    }
    if(
GunoierJob[playerid] == 6)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid2229.7378,-1977.7834,13.99285.0);
        
GivePlayerMoney(playerid9213);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ti-ai terminat tura! Mai poti face ture suplimentare dacг mai doresti!");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Sau poti iesi, scriind: {FF0000}/Iesi!");
        
GunoierJob[playerid] = 0;
        
DisablePlayerCheckpoint(playerid);
        return 
1;
    }
    
//==========================================================================
    
if(PizzaJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid1442.1306,-1585.9479,13.1088 ,5.0);
        
PizzaJob[playerid] = 2;
        
GivePlayerMoney(playerid5430);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru prima livrare suma de bani: {FF0000}5430 $!");
        return 
1;
    }
    if(
PizzaJob[playerid] == 2)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid1203.1559,-1438.2799,13.0255 ,5.0);
        
PizzaJob[playerid] = 3;
        
GivePlayerMoney(playerid6794);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru a doua livrare suma de bani: {FF0000}6794 $!");
        return 
1;
    }
    if(
PizzaJob[playerid] == 3)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid1530.6595,-1433.8102,13.1111 ,5.0);
        
PizzaJob[playerid] = 4;
        
GivePlayerMoney(playerid3965);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru a treia livrare suma de bani: {FF0000}3965 $!");
        return 
1;
    }
    if(
PizzaJob[playerid] == 4)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid1997.0874,-1453.9196,13.1161 ,5.0);
        
PizzaJob[playerid] = 5;
        
GivePlayerMoney(playerid7823);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru a patra livrare suma de bani: {FF0000}7823 $!");
        return 
1;
    }
    if(
PizzaJob[playerid] == 5)
    {
        
DisablePlayerCheckpoint(playerid);
        
SetPlayerCheckpoint(playerid2095.1331,-1776.1432,13.1031 ,5.0);
        
PizzaJob[playerid] = 6;
        
GivePlayerMoney(playerid5672);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru a cincea livrare suma de bani: {FF0000}5672 $!");
        return 
1;
    }
    if(
PizzaJob[playerid] == 6)
    {
        
DisablePlayerCheckpoint(playerid);
        
PizzaJob[playerid] = 0;
        
GivePlayerMoney(playerid9182);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru a ultima livrare suma de bani: {FF0000}9182 $!");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ti s-a terminat tura. Poti face ture suplimentare dacг doresti!");
        return 
1;
    }
    
//==========================================================================
    
if(TaietorJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
TaietorJob[playerid] = 2;
        
SetPlayerCheckpoint(playerid773.2032,-1242.4979,13.13175.0);
        
GivePlayerMoney(playerid1002);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani: {FF0000}1002 $!");
        return 
1;
    }
    if(
TaietorJob[playerid] == 2)
    {
        
DisablePlayerCheckpoint(playerid);
        
TaietorJob[playerid] = 3;
        
SetPlayerCheckpoint(playerid749.0557,-1257.6147,13.1412,5.0);
        
GivePlayerMoney(playerid1441);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani: {FF0000}1441 $!");
        return 
1;
    }
    if(
TaietorJob[playerid] == 3)
    {
        
DisablePlayerCheckpoint(playerid);
        
TaietorJob[playerid] = 4;
        
SetPlayerCheckpoint(playerid740.0237,-1287.6920,13.14595.0);
        
GivePlayerMoney(playerid1551);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani: {FF0000}1571 $!");
        return 
1;
    }
    if(
TaietorJob[playerid] == 4)
    {
        
DisablePlayerCheckpoint(playerid);
        
TaietorJob[playerid] = 5;
        
SetPlayerCheckpoint(playerid774.9744,-1277.7102,13.14585.0);
        
GivePlayerMoney(playerid1551);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani: {FF0000}1231 $!");
        return 
1;
    }
    if(
TaietorJob[playerid] == 5)
    {
        
DisablePlayerCheckpoint(playerid);
        
TaietorJob[playerid] = 6;
        
SetPlayerCheckpoint(playerid752.9723,-1260.6201,13.13955.0);
        
GivePlayerMoney(playerid1551);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani: {FF0000}1241 $!");
        return 
1;
    }
    if(
TaietorJob[playerid] == 6)
    {
        
DisablePlayerCheckpoint(playerid);
        
TaietorJob[playerid] = 0;
        
GivePlayerMoney(playerid2121);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani: {FF0000}2121 $!");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ti-ai terminat tura!");
        return 
1;
    }
    
//===============================TIRIST=====================================
    
if(CamionagiuJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
CamionagiuJob[playerid] = 2;
        
GivePlayerMoney(playerid13213);
        
SetPlayerCheckpoint(playerid68.5184,-223.8562,1.13855.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}13213 $!");
        return 
1;
    }
    if(
CamionagiuJob[playerid] == 2)
    {
        
DisablePlayerCheckpoint(playerid);
        
CamionagiuJob[playerid] = 3;
        
GivePlayerMoney(playerid15932);
        
SetPlayerCheckpoint(playerid361.5314,-147.2714,1.52145.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}15932 $!");
        return 
1;
    }
    if(
CamionagiuJob[playerid] == 3)
    {
        
DisablePlayerCheckpoint(playerid);
        
CamionagiuJob[playerid] = 4;
        
GivePlayerMoney(playerid16441);
        
SetPlayerCheckpoint(playerid446.1693,-468.6712,36.39435.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}16441 $!");
        return 
1;
    }
    if(
CamionagiuJob[playerid] == 4)
    {
        
DisablePlayerCheckpoint(playerid);
        
CamionagiuJob[playerid] = 5;
        
GivePlayerMoney(playerid13212);
        
SetPlayerCheckpoint(playerid162.9215,-1404.0992,46.11565.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}13212 $!");
        return 
1;
    }
    if(
CamionagiuJob[playerid] == 5)
    {
        
DisablePlayerCheckpoint(playerid);
        
CamionagiuJob[playerid] = 6;
        
GivePlayerMoney(playerid17432);
        
SetPlayerCheckpoint(playerid, -88.3408,-1123.5488,0.66085.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}17432 $!");
        return 
1;
    }
    if(
CamionagiuJob[playerid] == 6)
    {
        
DisablePlayerCheckpoint(playerid);
        
CamionagiuJob[playerid] = 0;
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ti-ai terminat tura cu succes. Poti face ture suplimentare dacг doresti!");
        return 
1;
    }
    
//============================VГNZГTOR======================================
    
if(VanzatorJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
VanzatorJob[playerid] = 2;
        
GivePlayerMoney(playerid9912);
        
SetPlayerCheckpoint(playerid1966.4468,-2014.7025,12.94595.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}9912 $!");
        return 
1;
    }
    if(
VanzatorJob[playerid] == 2)
    {
        
DisablePlayerCheckpoint(playerid);
        
VanzatorJob[playerid] = 3;
        
GivePlayerMoney(playerid8841);
        
SetPlayerCheckpoint(playerid1996.1888,-1757.2458,12.94175.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}8841 $!");
        return 
1;
    }
    if(
VanzatorJob[playerid] == 3)
    {
        
DisablePlayerCheckpoint(playerid);
        
VanzatorJob[playerid] = 4;
        
GivePlayerMoney(playerid8921);
        
SetPlayerCheckpoint(playerid2210.5994,-1750.5896,13.01325.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}8921 $!");
        return 
1;
    }
    if(
VanzatorJob[playerid] == 4)
    {
        
DisablePlayerCheckpoint(playerid);
        
VanzatorJob[playerid] = 5;
        
GivePlayerMoney(playerid12312);
        
SetPlayerCheckpoint(playerid2113.4717,-2102.0234,13.12085.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}12312 $!");
        return 
1;
    }
    if(
VanzatorJob[playerid] == 5)
    {
        
DisablePlayerCheckpoint(playerid);
        
VanzatorJob[playerid] = 0;
        
GivePlayerMoney(playerid12321);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ti-ai terminat tura. Poti face ore suplimentare, dacг doresti!");
        return 
1;
    }
    
//==========================LIVRATOR========================================
    
if(LivratorJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
LivratorJob[playerid] = 2;
        
GivePlayerMoney(playerid9382);
        
SetPlayerCheckpoint(playerid1229.6967,-1411.1860,13.25485.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}9382 $!");
        return 
1;
    }
    if(
LivratorJob[playerid] == 2)
    {
        
DisablePlayerCheckpoint(playerid);
        
LivratorJob[playerid] = 3;
        
GivePlayerMoney(playerid7892);
        
SetPlayerCheckpoint(playerid1433.1575,-1722.6649,13.45365.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}7823 $!");
        return 
1;
    }
    if(
LivratorJob[playerid] == 3)
    {
        
DisablePlayerCheckpoint(playerid);
        
LivratorJob[playerid] = 4;
        
GivePlayerMoney(playerid8954);
        
SetPlayerCheckpoint(playerid825.2704,-1789.3202,13.89545.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}8954 $!");
        return 
1;
    }
    if(
LivratorJob[playerid] == 4)
    {
        
DisablePlayerCheckpoint(playerid);
        
LivratorJob[playerid] = 5;
        
GivePlayerMoney(playerid8954);
        
SetPlayerCheckpoint(playerid386.4106,-1513.9083,32.60005.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit suma de bani, pentru aceasta livrare: {FF0000}8954 $!");
        return 
1;
    }
    if(
LivratorJob[playerid] == 5)
    {
        
DisablePlayerCheckpoint(playerid);
        
LivratorJob[playerid] = 0;
        
GivePlayerMoney(playerid3822);
        
SetPlayerCheckpoint(playerid386.4106,-1513.9083,32.60005.0);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ti-ai terminat tura. Poti face ore suplimentare dacг doresti!");
        return 
1;
    }
    
//==========================FERMIER=========================================
    
if(FermierJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
FermierJob[playerid] = 2;
        
GivePlayerMoney(playerid3822);
        
SetPlayerCheckpoint(playerid, -530.1547,-1401.9867,12.82665.0);
        return 
1;
    }
    if(
FermierJob[playerid] == 2)
    {
        
DisablePlayerCheckpoint(playerid);
        
FermierJob[playerid] = 3;
        
GivePlayerMoney(playerid3822);
        
SetPlayerCheckpoint(playerid, -584.9694,-1368.7939,17.19935.0);
        return 
1;
    }
    if(
FermierJob[playerid] == 3)
    {
        
DisablePlayerCheckpoint(playerid);
        
FermierJob[playerid] = 4;
        
GivePlayerMoney(playerid3822);
        
SetPlayerCheckpoint(playerid, -528.5095,-1306.6334,19.93295.0);
        return 
1;
    }
    if(
FermierJob[playerid] == 4)
    {
        
DisablePlayerCheckpoint(playerid);
        
FermierJob[playerid] = 5;
        
GivePlayerMoney(playerid3822);
        
SetPlayerCheckpoint(playerid, -459.2954,-1294.7139,32.75925.0);
        return 
1;
    }
    if(
FermierJob[playerid] == 5)
    {
        
DisablePlayerCheckpoint(playerid);
        
FermierJob[playerid] = 6;
        
GivePlayerMoney(playerid3822);
        
SetPlayerCheckpoint(playerid, -396.3111,-1312.5621,27.66155.0);
        return 
1;
    }
    if(
FermierJob[playerid] == 6)
    {
        
DisablePlayerCheckpoint(playerid);
        
FermierJob[playerid] = 7;
        
GivePlayerMoney(playerid3822);
        
SetPlayerCheckpoint(playerid, -362.1909,-1398.0966,20.55495.0);
        return 
1;
    }
    if(
FermierJob[playerid] == 7)
    {
        
DisablePlayerCheckpoint(playerid);
        
FermierJob[playerid] = 0;
        
GivePlayerMoney(playerid3822);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ti-ai terminat tura. Poti face ore suplimentare!");
        return 
1;
    }
    
//===============================HOTDOG=====================================
    
if(HotdogJob[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
HotdogJob[playerid] = 2;
        
GivePlayerMoney(playerid12122);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru livrare: {FF0000}12122 $$!");
        
SetPlayerCheckpoint(playerid2106.6611,-1428.0917,23.82875.0);
        return 
1;
    }
    if(
HotdogJob[playerid] == 2)
    {
        
DisablePlayerCheckpoint(playerid);
        
HotdogJob[playerid] = 3;
        
GivePlayerMoney(playerid6874);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru livrare: {FF0000}6874 $$!");
        
SetPlayerCheckpoint(playerid2008.3776,-1677.8745,13.32855.0);
        return 
1;
    }
    if(
HotdogJob[playerid] == 3)
    {
        
DisablePlayerCheckpoint(playerid);
        
HotdogJob[playerid] = 0;
        
GivePlayerMoney(playerid18934);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ai primit pentru ultima livrare: {FF0000}18934 $$!");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"Ti-ai incheiat tura {FF0000}!");
        return 
1;
    }
    if(
IsPlayerInAnyVehicle(playerid))
     return 
SendClientMessage(playerid, -1,"{ff0000}Nu poti primi pachetul stand in masina!");
    new 
string[128], nome[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnomesizeof(nome));
    
format(stringsizeof string,"{ff0000}[PACHET AERIAN]{ffffff}: %s a luat pachetul",nome);
    
SendClientMessageToAll(-1,string);
    
Delete3DTextLabel(airlabel);
    
DisablePlayerCheckpoint(playerid);
    
DestroyObject(air);
    
ShowPlayerDialog(
    return 
1;
}
forward Airdrop();
public 
Airdrop()
{
    
Delete3DTextLabel(airlabel);
    
DestroyObject(air);
    
//Criar TextLabel
    
airlabel Create3DTextLabel("{fff700}AIRDROP:{ffffff}Acest pachet militar \ncontine mai multe arme",0xFFFFFF,306.426182026.7247316.73662300);
    
//Criar e Mover Airdrop
    
air CreateObject(18849, -223.3057991.915945.12560.000000.000000.00000);
    
MoveObject(air, -221.5663,992.9471,20.83973.0);
    
//Setar Checkpoint Para o Jogador
    
for(new i=0MAX_PLAYERSi++)
    {
        
DisablePlayerCheckpoint(i);
        
SetPlayerCheckpoint(i, -222.0864,992.7004,19.5774,3);
    }
    
//Enviar Mensagem Que o Airdrop Foi Solto
    
SendClientMessageToAll(-1"{ff0000}[AIRDROP]: {ffffff}PText");
    
printf(" ");
    new 
horaminutosegundogettime(hora,minuto,segundo);
    
printf("> [PACHET AERIAN]: Pachetul Aerian a fost lansat la  Fort Carson Sherrif Department: Ora: [%i/%i/%i]"horaminutosegundo);
    return 
1;

Reply
#2

The best way would be creating an array containing all the locations of the checkpoints. After the array you'd have to go manually with a 1 sec timer which would check if player is on a job, in this case it would be the job ID associated to the checkpoints and a count variable probably. Then you'd check if the player is in range of those points and give them the price that could be also set thru the array.

If you're looking for the code to be done for you, you're wrong. You'd have to script it all yourself, unfortunately. From there on when you're stuck, you could always ask for help.
Reply
#3

Quote:
Originally Posted by Cypress
Посмотреть сообщение
If you're looking for the code to be done for you, you're wrong. You'd have to script it all yourself, unfortunately. From there on when you're stuck, you could always ask for help.
Give me an exemple with 1 array an then I can do it, I don't know how to attach arrays as checkpoint
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)