Script help
#1

How i can make this two functions in one'

First
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
    {
    new 
msg[255];
    if     (
newstate==PLAYER_STATE_DRIVER)
        {
        if (
GetVehicleModel(GetPlayerVehicleID(playerid)) == 420)
            {
            if     (
avisado[playerid]==-1)
                {
                
GameTextForPlayer(playerid,"~w~Press ~b~Buttom 2~n~~w~to start the ~n~~r~TAXI~w~ Minimissions.",3000,5);
                }
            else
                {
                
KillTimer(avisado[playerid]);
                
avisado[playerid]=-1;
                }
            }
        }
    if     (
newstate==PLAYER_STATE_ONFOOT)
        {
        if     ((
playerInMiniMission[playerid]>0)&&(avisado[playerid]==-1))
            {
            
GameTextForPlayer(playerid,"~w~You have ~r~10 sec ~n~~w~ to enter a ~r~TAXI",3000,4);
            
avisado[playerid]=SetTimerEx("terminarMission",10000,0,"%d",playerid);
            }
        if     (
OnTaxiAsPassenger[playerid]!=-1)
            {
            new 
taxista OnTaxiAsPassenger[playerid];
            new 
name[MAX_PLAYER_NAME];
            
GetPlayerName(taxista,name,MAX_PLAYER_NAME);
            
OnTaxiAsPassenger[playerid]=-1;
            new 
viaje CostoDelViaje[playerid];
            
format(msg,sizeof(msg),"~w~You pay to ~g~%s ~n~~r~$%d~w~ for the ~r~taxi~w~ ride.",name,viaje);
            
GameTextForPlayer(playerid,msg,3000,4);
            
format(msg,sizeof(msg),"~w~You get ~r~$%d~w~ ~n~for the ~r~taxi~w~ ride.",viaje);
            
GameTextForPlayer(taxista,msg,3000,4);
            
GivePlayerMoney(playerid,-viaje);
            
GivePlayerMoney(taxista,viaje);
            
cantidadPasajeros--;
            if     (
cantidadPasajeros==0)
                {
                
KillTimer(caidadefichaTimer);
                }
            }
        }
    if     (
newstate==PLAYER_STATE_PASSENGER)
        {
        if (
GetVehicleModel(GetPlayerVehicleID(playerid)) == 420)
            {
            new 
i=0;
              while     (
i<MAX_PLAYERS)
                      {
                      if     ((
playerInMiniMission[i]==1)&&(GetPlayerState(i)==PLAYER_STATE_DRIVER))
                          {
                        if     (
GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
                            {
                            new 
name[MAX_PLAYER_NAME];
                            
GetPlayerName(i,name,MAX_PLAYER_NAME);
                            
contador[i]++;
                            
format(msg,sizeof(msg),"~w~You have gotten into ~n~~g~%s's ~r~TAXI~w~",name);
                            
GameTextForPlayer(playerid,msg,3000,4);
                            
format(msg,sizeof(msg),"~w~You have one new~n~~r~PASENGER~w~");
                            
GameTextForPlayer(playerid,msg,3000,4);
                            
OnTaxiAsPassenger[playerid]=i;
                            
CostoDelViaje[playerid]=BAJADA_DE_BANDERA;
                            if     (
cantidadPasajeros==0)
                                {
                                
caidadefichaTimer=SetTimer("caidadeficha",30000,1);
                                }
                            
cantidadPasajeros++;
                            
i=MAX_PLAYERS;
                            }
                          }
                      
i++;
                      }
            }
        }
    return 
1;
    }

The second

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
LicenseInfo[playerid][Car] < 1)
        {
            switch(
GetVehicleModel(GetPlayerVehicleID(playerid)))
            {
                case 
430417425446452453454464465469472473476484487488493497501511512513519553563577592593595447//Vehicle IDs.
                
{
                    
SendClientMessage(playerid0xFF6347AA"111111111111111111111111111111!");
                    
RemovePlayerFromVehicle(playerid);
                }
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
Script help - by boyan96 - 01.05.2012, 05:58
Re: Script help - by warcodes_ - 01.05.2012, 06:03
Re: Script help - by boyan96 - 01.05.2012, 06:17
Re: Script help - by warcodes_ - 01.05.2012, 06:44

Forum Jump:


Users browsing this thread: 1 Guest(s)