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.