Jump to content
  • 0

Checkpoint random


Buckzor

Question

Salut am incercat sa fac un job si checkpointurile sa fie random unul dupa altul fara sa se termine job-ul.. adica cand intru in cp imi da banii si ma trimite la altul si

	if(CPizza[playerid] == 1)
	{
	    PlayerInfo[playerid][pMoney] = PlayerInfo[playerid][pMoney] + 3000;
	    SendClientMessage(playerid, -1, "Ai primit 3000$ pentru aceasta livrare.");
	    //SendClientMessage(playerid, -1, "Daca doresti sa mai livrezi pizza, mergi inapoi la magazin si foloseste comanda /startdelivery.");
	    CPizza[playerid] = 1;
	    livrare[playerid] = 1;
	    //DisablePlayerCheckpoint(playerid);
	}
CMD:work(playerid, params[])
{
    new rand;
    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Nu esti conectat.");
    if(PlayerInfo[playerid][pJob] != 1) return SendClientMessage(playerid, -1, "Nu detii job-ul Pizza Boy.");
    if(livrare[playerid] != 0) return SendClientMessage(playerid, -1, "Deja livrezi pizza.");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Trebuie sa fii intr-un vehicul pentru a incepe livrarile.");
    if(!IsPlayerInRangeOfPoint(playerid, 4.0, 2066.3320, -1717.3853, 14.1363)) return SendClientMessage(playerid, -1, "Trebuie sa fii in fata magazinui de pizza pentru a incepe livrarile.");
    rand = random(sizeof(RandomPizza));
    CPizza[playerid] = 1;
    livrare[playerid] = 1;
    SetPlayerCheckpoint(playerid, RandomPizza[rand][0], RandomPizza[rand][1], RandomPizza[rand][2], 2.0);
    SendClientMessage(playerid, -1, "Mergi la punctul marcat pe harta pentru a livra pizza.");
    SendClientMessage(playerid, -1, "Daca doresti sa anulezi livrarea foloseste comanda /stopdelivery.");
    return 1;
}

 

Edited by Buckzor
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

if(CPizza[playerid] == 1)
    {
            new rand;
        PlayerInfo[playerid][pMoney] = PlayerInfo[playerid][pMoney] + 3000;
        SendClientMessage(playerid, -1, "Ai primit 3000$ pentru aceasta livrare.");
        //SendClientMessage(playerid, -1, "Daca doresti sa mai livrezi pizza, mergi inapoi la magazin si foloseste comanda /startdelivery.");
        CPizza[playerid] = 1;
        livrare[playerid] = 1;
            rand = random(sizeof(RandomPizza));
            SetPlayerCheckpoint(playerid, RandomPizza[rand][0], RandomPizza[rand][1], RandomPizza[rand][2], 2.0);
        //DisablePlayerCheckpoint(playerid);
    }

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.