What can be wrong?
#1

Код:
public terminarMission(playerid)
{
        new msg[256];
        format(msg,sizeof(msg),"~r~Taxi job cancelled ~w~And You carried ~y~%d~w~ pasengers.",contador[playerid]);
        GameTextForPlayer(playerid,msg,3000,4);
        playerInMiniMission[playerid]=-1;
        avisado[playerid]=-1;
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        format(msg,sizeof(msg),"%s (%d) is no longer a taxi drive.",name, playerid);
        SendClientMessageToAll(GREEN, msg);
        SendClientMessage(playerid,RED,"Taxi Job Cancelled.");
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        for (new i=0;i<MAX_PLAYERS;i++)
        {
             if(playerid!=i)
             {
                    SendClientMessage(i,0xFFFF00AA," ");
                    SendClientMessage(i,0xFFFF00AA,msg);
             }
        }
        for (new i=0;i<MAX_PLAYERS;i++)
        {
                if(OnTaxiAsPassenger[i]==playerid)
                {
                        new taxista = playerid;
                        OnTaxiAsPassenger[i]=-1;
                        new viaje=CostoDelViaje[i];
                        format(msg,sizeof(msg),"~w~You pay to ~g~%s ~n~~r~$%d~w~ for the ~r~taxi~w~ ride.",name,viaje);
                        GameTextForPlayer(i,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);
                        GivePlayerCashEx(i,-viaje);
                        GivePlayerCashEx(taxista,viaje);
                        cantidadPasajeros--;
                        if(cantidadPasajeros==0)
                        {
                                KillTimer(caidadefichaTimer);
                        }
                }
        }
        contador[playerid]=0;
        return 1;
}
Код:
(7779) : warning 219: local variable "msg" shadows a variable at a preceding level
Reply
#2

Did u define new msg[256]; twice?
Eg:
new msg[256];
new msg[256];

Try making it like:
new msg[256];
new msgtwo[256];
Reply
#3

PHP код:
public terminarMission(playerid)
{
        new 
msgg[256];
        
format(msgg,sizeof(msgg),"~r~Taxi job cancelled ~w~And You carried ~y~%d~w~ pasengers.",contador[playerid]);
        
GameTextForPlayer(playerid,msgg,3000,4);
        
playerInMiniMission[playerid]=-1;
        
avisado[playerid]=-1;
        new 
name[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        
format(msgg,sizeof(msgg),"%s (%d) is no longer a taxi drive.",nameplayerid);
        
SendClientMessageToAll(GREENmsgg);
        
SendClientMessage(playerid,RED,"Taxi Job Cancelled.");
        
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        for (new 
i=0;i<MAX_PLAYERS;i++)
        {
             if(
playerid!=i)
             {
                    
SendClientMessage(i,0xFFFF00AA," ");
                    
SendClientMessage(i,0xFFFF00AA,msgg);
             }
        }
        for (new 
i=0;i<MAX_PLAYERS;i++)
        {
                if(
OnTaxiAsPassenger[i]==playerid)
                {
                        new 
taxista playerid;
                        
OnTaxiAsPassenger[i]=-1;
                        new 
viaje=CostoDelViaje[i];
                        
format(msgg,sizeof(msgg),"~w~You pay to ~g~%s ~n~~r~$%d~w~ for the ~r~taxi~w~ ride.",name,viaje);
                        
GameTextForPlayer(i,msgg,3000,4);
                        
format(msgg,sizeof(msgg),"~w~You get ~r~$%d~w~ ~n~for the ~r~taxi~w~ ride.",viaje);
                        
GameTextForPlayer(taxista,msgg,3000,4);
                        
GivePlayerCashEx(i,-viaje);
                        
GivePlayerCashEx(taxista,viaje);
                        
cantidadPasajeros--;
                        if(
cantidadPasajeros==0)
                        {
                                
KillTimer(caidadefichaTimer);
                        }
                }
        }
        
contador[playerid]=0;
        return 
1;

Reply
#4

Yeah fixed it but thanks for responding me fast.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)