[Ajuda] Sistema de Medico
#1

Fiz um sistema de medico que quando uma vitima ta no chao ai o medico chega perto da vitima e reanima ela com um comando sem precisar bota o ID dela no comando tipo: /reanimar , ai si tiver perto de uma vitima reanima ela e puxa ela para o veiculo, so q eu fiz com giveplayerid so q n defeni qm й o giveplayerid porque nгo sei qm eu uso para dizer que giveplayerid й aquela vitima que ele curou pq n uso ID no comando ex: tmp = strtok(cmdtext, idx); e giveplayerid = ReturnUser(tmp);
Reply
#2

Poste seu cуdigo para vermos o que tem de errado
Reply
#3

PHP код:
if(strcmp(cmd"/reanimar",true)==0)
    {
        if(
PlayerInfo[playerid][Emprego] == 2)
        {
            for(new 
iMAX_PLAYERSi++)
            {
                new 
giveplayeridFloatxFloatyFloatz;
                if(
PlayerSolicitoMedico[i] == true)
                {
                    
GetPlayerPos(ixyz);
                    if(
PlayerToPoint(2.0playeridxyz))
                    {
                         
SendClientMessage(giveplayerid, -1"O mйdico estб tentando reanima-lo.");
                        
SendClientMessage(playerid, -1"Vocк estб tentando reanimando o player");
                        
Controle(playerid0);
                        
ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,0,8000);
                        
ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,0,8000);
                        
PlayerSolicitoMedico[giveplayerid] = false;
                        
SetTimerEx("LevaPacAmbulancia"80000"i"playerid);
                        
printf("%d",giveplayerid);
                        return 
true;
                    } else return 
SendClientMessage(playerid, -1"Vocк nгo estб perto de nenhuma vitima.");
                }
            }
            return 
true;
        } else return 
SendClientMessage(playerid, -1"Vocк nгo й Mйdico.");
    
}
forward LevaPacAmbulancia(playerid);
public 
LevaPacAmbulancia(playerid){
    new 
giveplayerid;
    
SendClientMessage(playeridCOR_LARANJA"Vocк conseguiu reanimar a vitima, entre na ambulвncia e dк /subir paciente.");
    
ReanimarPac[playerid] = true;
    
Controle(playerid1);
    
SetPlayerHealth(giveplayerid100);
    
printf("%d",giveplayerid);
    for(new 
mm<MAX_PLAYERSm++)
    {
        if(
PlayerInfo[m][Emprego] == 2)
        {
            
RemovePlayerMapIcon(m0);
            return 
true;
        }
    }
    return 
1;
}
if(
strcmp(cmd"/subir",true)==0)
    {
        new 
x_tmp[32];
        
x_tmp strtok(cmdtextidx);
        if(!
strlen(x_tmp))
        {
            
SendClientMessage(playeridCOR_LARANJA"Use: /subir [serviзo]");
            
SendClientMessage(playeridCOR_AMARELO"Serviзos: /subir paciente || /subir suspeito");
            return 
true;
        }
        if(
strcmp(x_tmp"paciente"true) == 0)
        {
            if(
PlayerInfo[playerid][Emprego] == 2)
            {
                if(
ReanimarPac[playerid] == true)
                {
                    new 
vehicleid;
                    
vehicleid GetPlayerVehicleID(playerid);
                    if(
IsPlayerInAnyVehicle(playerid) && GetVehicleModel(vehicleid) == 416)
                    {
                        new 
Floatx,Floaty,Floatz;
                        new 
giveplayerid;
                        
GetPlayerPos(giveplayeridxyz);
                        if(
PlayerToPoint(10.0playeridxyz))
                        {
                            
KillTimer(TimerMorto[giveplayerid]);
                            
Controle(giveplayerid0);
                            
PutPlayerInVehicle(giveplayeridvehicleid2);
                            
SendClientMessage(playerid, -1"O paciente estб na ambulвncia leve-o imediatamente para o Hospital mais prуximo.");
                            
SetPlayerCheckpoint(playerid1178.4418,-1308.8868,13.774810.0);
                            
PacienteAmbulancia[playerid] = true;
                            
printf("%d",giveplayerid);
                            return 
true;
                        } else return 
SendClientMessage(playerid, -1"Vocк precisa estar perto da vitima.");
                    } else return 
SendClientMessage(playerid, -1"Vocк precisa estar em uma ambulвncia.");
                } else return 
SendClientMessage(playerid, -1"Vocк nгo reanimou nenhuma vitima.");
            } else return 
SendClientMessage(playerid, -1"Vocк nгo й Mйdico.");
        }
        return 
1;

Reply
#4

Vish, eu nгo sei jeitos de fazer isto mas se fizer para players individuais tipo /reanimar [ id ], ai da pra fazer
(meu cйrebro travou, acho que й falta de cafй, ou й fome que tou agora)
Reply
#5

kkkkk vlw mano
Reply
#6

tente:
junto as news no comeзo da sua gm
PHP код:
new PlayerASerCurado[MAX_PLAYERS]; 
PHP код:
if(strcmp(cmd"/reanimar",true)==0)
    {
        if(
PlayerInfo[playerid][Emprego] == 2)
        {
            for(new 
iMAX_PLAYERSi++)
            {
                
FloatxFloatyFloatz;
                if(
PlayerSolicitoMedico[i] == true)
                {
                    
GetPlayerPos(ixyz);
                    if(
PlayerToPoint(2.0playeridxyz))
                    {
                        
PlayerASerCurado[playerid] = i;
                        
                        
SendClientMessage(PlayerASerCurado[playerid], -1"O mйdico estб tentando reanima-lo.");
                        
SendClientMessage(playerid, -1"Vocк estб tentando reanimando o player");
                        
Controle(playerid0);
                        
ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,0,8000);
                        
ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,0,8000);
                        
PlayerSolicitoMedico[PlayerASerCurado[playerid]] = false;
                        
SetTimerEx("LevaPacAmbulancia"80000"i"playerid);
                        
printf("%d",PlayerASerCurado[playerid]);
                        return 
true;
                    } else return 
SendClientMessage(playerid, -1"Vocк nгo estб perto de nenhuma vitima.");
                }
            }
            return 
true;
        } else return 
SendClientMessage(playerid, -1"Vocк nгo й Mйdico.");

}

forward LevaPacAmbulancia(playerid);
public 
LevaPacAmbulancia(playerid){
    
SendClientMessage(playeridCOR_LARANJA"Vocк conseguiu reanimar a vitima, entre na ambulвncia e dк /subir paciente.");
    
ReanimarPac[playerid] = true;
    
Controle(playerid1);
    
SetPlayerHealth(PlayerASerCurado[playerid], 100);
    
printf("%d",PlayerASerCurado[playerid]);
    for(new 
mm<MAX_PLAYERSm++)
    {
        if(
PlayerInfo[m][Emprego] == 2)
        {
            
RemovePlayerMapIcon(m0);
            return 
true;
        }
    }
    return 
1;
}

if(
strcmp(cmd"/subir",true)==0)
    {
        new 
x_tmp[32];
        
x_tmp strtok(cmdtextidx);
        if(!
strlen(x_tmp))
        {
            
SendClientMessage(playeridCOR_LARANJA"Use: /subir [serviзo]");
            
SendClientMessage(playeridCOR_AMARELO"Serviзos: /subir paciente || /subir suspeito");
            return 
true;
        }
        if(
strcmp(x_tmp"paciente"true) == 0)
        {
            if(
PlayerInfo[playerid][Emprego] == 2)
            {
                if(
ReanimarPac[playerid] == true)
                {
                    new 
vehicleid;
                    
vehicleid GetPlayerVehicleID(playerid);
                    if(
IsPlayerInAnyVehicle(playerid) && GetVehicleModel(vehicleid) == 416)
                    {
                        new 
Floatx,Floaty,Floatz;
                        
GetPlayerPos(PlayerASerCurado[playerid], xyz);
                        if(
PlayerToPoint(10.0playeridxyz))
                        {
                            
KillTimer(TimerMorto[PlayerASerCurado[playerid]]);
                            
Controle(PlayerASerCurado[playerid], 0);
                            
PutPlayerInVehicle(PlayerASerCurado[playerid], vehicleid2);
                            
SendClientMessage(playerid, -1"O paciente estб na ambulвncia leve-o imediatamente para o Hospital mais prуximo.");
                            
SetPlayerCheckpoint(playerid1178.4418,-1308.8868,13.774810.0);
                            
PacienteAmbulancia[playerid] = true;
                            
printf("%d",PlayerASerCurado[playerid]);
                            return 
true;
                        } else return 
SendClientMessage(playerid, -1"Vocк precisa estar perto da vitima.");
                    } else return 
SendClientMessage(playerid, -1"Vocк precisa estar em uma ambulвncia.");
                } else return 
SendClientMessage(playerid, -1"Vocк nгo reanimou nenhuma vitima.");
            } else return 
SendClientMessage(playerid, -1"Vocк nгo й Mйdico.");
        }
        return 
1;

*Nгo testado.
Reply
#7

Funciono Mano Vlw Rep+
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)