[AJUDA]Veiculos Trancados
#3

PHP код:
    if(strcmp(cmd"/trancar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
carid;
            if (
gTeam[playerid] == || gTeam[playerid] == 1)
            {
                if(
gLastCar[playerid] == && PlayerInfo[playerid][pPhousekey] == 255)
                {
                    
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem um veнculo.");
                    return 
1;
                }
                else if(
gLastCar[playerid] != && gLastCar[playerid] != PlayerInfo[playerid][pPhousekey]+1)
                {
                    if (
HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] != 299)
                    {
                        
gLastDriver[HireCar[playerid]] = 300;
                        
gCarLock[HireCar[playerid]] = 0;
                        
UnLockCar(HireCar[playerid]);
                    }
                    
HireCar[playerid] = gLastCar[playerid];
                }
            }
            if (
PlayerInfo[playerid][pPhousekey] == 255)
            {
                if(
HireCar[playerid] == 299)
                {
                    
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem um veнculo.");
                    return 
1;
                }
            }
            
carid PlayerInfo[playerid][pPhousekey]+1;
            if(
HireCar[playerid] != 299 && !SwitchKey[playerid])
            {
                
carid HireCar[playerid];
            }
            
//new driver = gLastDriver[carid];
            
new lockstatus gCarLock[carid];
            new 
Float:cx,Float:cy,Float:cz;
            
GetVehiclePos(caridcxcycz);
            switch (
lockstatus)
            {
                case 
0:
                {
                    if(
HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
                    {
                        
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem um veнculo.");
                        return 
1;
                    }
                    if(
HireCar[playerid] == carid && !SwitchKey[playerid])
                    {
                        
GameTextForPlayer(playerid"~w~Veнculo ~r~Trancado"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 1;
                        
LockCar(carid);
                    }
                    else if (
PlayerInfo[playerid][pPhousekey] == carid-1)
                    {
                        
GameTextForPlayer(playerid"~w~Veнculos ~r~Trancados"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 1;
                        
LockCar(carid);
                        return 
1;
                    }
                }
                case 
1:
                {
                    if(
HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
                    {
                        
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem um veнculo.");
                        return 
1;
                    }
                    if(
HireCar[playerid] == carid && !SwitchKey[playerid])
                    {
                        
GameTextForPlayer(playerid"~w~Veнculo ~g~Destrancado"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 0;
                        
UnLockCar(carid);
                    }
                    if (
PlayerInfo[playerid][pPhousekey] == carid-1)
                    {
                        
GameTextForPlayer(playerid"~w~Veнculos ~g~Destrancados"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 0;
                        
UnLockCar(carid);
                        return 
1;
                    }
                }
                default:
                {
                    
SendClientMessage(playeridCOLOR_RED" Erro");
                }
            }
            if(
carid == 256)
            {
                
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem um veнculo.");
            }
        }
        return 
1;
    } 
Reply


Messages In This Thread
[AJUDA]Veiculos Trancados - by [Dk]TuReTOo - 19.06.2011, 15:58
Re: [AJUDA]Veiculos Trancados - by DreeH - 19.06.2011, 16:03
Re: [AJUDA]Veiculos Trancados - by [Dk]TuReTOo - 19.06.2011, 16:05

Forum Jump:


Users browsing this thread: 1 Guest(s)