Jump to content

Question

2 answers to this question

Recommended Posts

  • 0
Posted
forward FailJob(playerid, reason[]);
public FailJob(playerid, reason[])
{
    new string[256];
    format(string, sizeof(string), "Munca ta a esuat! Motiv: %s", reason);
    SCM(playerid, 0xFFFF00FF, string);
    DestroyVehicle(PlayerCar[playerid]);
    PlayerCar[playerid] = 0;
    JobWorking[playerid] = 0;
    DisablePlayerCheckpoint(playerid);
    JobCP[playerid] = 0;
    return 1;
}
forward FinishJob(playerid, reason[]);
public FinishJob(playerid, reason[])
{
    new string[256];
    format(string, sizeof(string), "Munca ta a esuat! Motiv: %s", reason);
	SCM(playerid, 0xFFFF00FF, string); // am adaugat asta ca sa afiseze textul
    DestroyVehicle(PlayerCar[playerid]);
    PlayerCar[playerid] = 0;
    JobWorking[playerid] = 0;
    DisablePlayerCheckpoint(playerid);
    JobCP[playerid] = 0;
    return 1;
} // aici ti-am sters o steluta cred ca era
public OnPlayerEnterCheckpoint(playerid)
{
    new string[256];
    switch(JobCP[playerid])
    {
        case 1:
        {
            DisablePlayerCheckpoint(playerid);
            JobCP[playerid] = 0;
            SCM(playerid, -1, "Acum poti folosi /work!");
        }
        case 2: SetPlayerCheckpoint(playerid, 2239.0498, 1286.7819, 10.8203, 5.0), JobCP[playerid] ++;
        case 3: SetPlayerCheckpoint(playerid, 2635.4045, 1850.0782, 11.0234, 5.0), JobCP[playerid] ++;
        case 4: SetPlayerCheckpoint(playerid, 2015.5530, 1151.5247, 10.8203, 5.0), JobCP[playerid] ++;
        case 5:
        {
            DisablePlayerCheckpoint(playerid);
            new money = 100000 + random(100000);
            format(string, sizeof(string), "Ai terminat de muncit si ai primit $%d", money);
            SCM(playerid, 0x00FFFFFF, string);
            GivePlayerMoney(playerid, money);
            FinishJob(playerid,"Sunt slab!"); //<----- AICI AM EROARE NR 2 
        }
    }
    return 1;
}

Deci nu ma mai pricep la dat explicatii, dar atunci cand folosesti functia FinishJob trebuie sa-i completezi toti parametri. Gen tu ai folosit doar FinishJob(playerid), dar nu ai completat si acel reason. Nu stiu daca e corect ce scriu, dar ar trebui sa mearga.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.