Jump to content

Recommended Posts

Posted
new intaxi[MAX_PLAYERS];
pui de exemplu cand intri intr-o masina de taxi, intaxi[playerid] = 1;
apoi cand iesi din masina intaxi[playerid] = 0;

public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
 if( intaxi[playerid] == 1) {
	new taxidriver = WhoIsDriver(GetPlayerVehicleID(playerid));
    SetPlayerCheckPoint(taxidriver,fX, fY, fZ);
    CP[taxidriver] = 929;
    SendClientMessage(taxidriver,-1,"Pasagerul a ales destiantia!");
    SendClientMessage(playerid,-1,"Ai ales destinatia");
 }
 return 1;
}
apoi mergi la
public OnPlayerEnterCheckpoint(playerid)
{
   switch(CP[playerid]) {
       case 929: {
       SendClientMessage(playerid,-1,"Ai adus playerul la destinatie!");
       DisablePlayerCheckPoints(playerid);
       CP[playerid] = 0;
       }
   }
}

// este un stock gasit la repezeala de pe net, nu recomand, dar daca esti incepator nu te complica
stock WhoIsDriver(vehicleid)
{
    for(new i = 0; i < MAX_PLAYERS; i++) //Loops through all players
    {
        if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return i; //Returns playerid if the player is in the vehicleid provided AND is the driver
    }
    return 1;
}

sper ca ai inteles ceva, l am facut la repezeala

asta e o baza, poti sa continui singur mai departe.

aqpUjAc.png

 

 

 

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.