SA-MP Forums Archive
[Pedido] Verificaзгo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Verificaзгo (/showthread.php?tid=625869)



Verificaзгo - LuanGamer - 07.01.2017

Boa tarde, estou desenvolvendo um complemento no cуdigo para verificar se ambos os players estгo dentro do veiculo (416, uma ambulancia) para o comando /cura, mas nгo obtive exito ainda, se alguйm puder ajudar segue o cуdigo:

PHP Code:
if(giveplayerid != INVALID_PLAYER_ID)
                {
                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    if(
PlayerInfo[playerid][pMembro]==20||PlayerInfo[playerid][pLider]==20)//||PlayerInfo[playerid][pMembro]==4||PlayerInfo[playerid][pLider]==4)//model
                    
{
                        new 
Veh GetPlayerVehicleID(playerid);
                        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 416)//IsAnAmbulanceCar(Veh)
                        
{
                            if(!
IsPlayerInVehicle(playeridVeh) && !IsPlayerInVehicle(giveplayeridVeh))
                            {
                            
SendClientMessage(playeridCOLOR_GRAD1"  Vocкs dois precisam estar na ambulвncia dos bombeiros!");
                            return 
true;
                            }
                            
format(stringsizeof(string), "~y~Voce curou da tontura ~n~~w~%s~n~~g~R$%d"giveplayer,mon);
                            
GameTextForPlayer(playeridstring50001);
                            
GiveDinheiro(playerid,mon);
                            
GiveDinheiro(giveplayerid,-mon);
                            
SetPlayerDrunkLevel(giveplayerid0);
                            
PlayerDrunk[giveplayerid] = 0;
                            
PlayerDrunkTime[giveplayerid] = 0;
                            
SetPlayerDrunkLevel (giveplayerid0);
                            if(
PlayerInfo[playerid][pPainPerk] > 0)
                            {
                            
SetPlayerDrunkLevel(giveplayerid0);
                            
PlayerDrunk[giveplayerid] = 0;
                            
PlayerDrunkTime[giveplayerid] = 0;
                            
SetPlayerDrunkLevel (giveplayerid0);
                            }
                            else
                            {
                            
SetPlayerDrunkLevel(giveplayerid0);
                            
PlayerDrunk[giveplayerid] = 0;
                            
PlayerDrunkTime[giveplayerid] = 0;
                            
SetPlayerDrunkLevel (giveplayerid0);
                            }
                            
PlayerPlaySound(playerid11500.00.00.0);
                            
PlayerPlaySound(giveplayerid11500.00.00.0);
                            
format(stringsizeof(string), "Vocк foi curado da tontura pelo bombeiro %s, por -R$%d",NomePlayer(playerid),mon);
                            
SendClientMessage(giveplayeridCOLOR_LIGHTBLUE,string);
                            if(
PlayerDrunk[giveplayerid] > 0)
                            {
                                
PlayerDrunk[giveplayerid] = 0;
                                
SendClientMessage(giveplayeridCOLOR_LIGHTBLUE"* Vocк nгo estб com tontura!");
                            }
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб autorizado a usar o comando!");
                        return 
true;
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1" Esse jogador estб offline");
            }
            return 
true;
    } 
Ainda estб curando com pelo menos 1 dos players do lado de dentro, e queria os dois. Obrigado pela atenзгo.