SA-MP Forums Archive
Variable de sexo - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Variable de sexo (/showthread.php?tid=376802)



Variable de sexo - Glimma - 11.09.2012

Buenas, en mi gamemode cuando un mйdico estб en servicio, por ejemplo, aparece "El mйdico X estб en servicio", por mбs que sea hombre o mujer.. їCуmo podrнa hacer para que en el caso de que sea mujer, diga "la mйdica"..

pawn Код:
if(JugadorInfo[para1][jSexo] == 1)//Hombre
if(JugadorInfo[para1][jSexo] == 2)//Mujer
Йste es el sistema:

pawn Код:
format(string, sizeof(string),"El mйdico %s estб de servicio.", NombreJugador(playerid));
                        SendClientMessageToAll(VERDE_OSCURO,string);
                        EntregarArma(playerid, 41, 350);
                        EnServicio[playerid] = 1;



Respuesta: Variable de sexo - Bu11Sh0t - 11.09.2012

pawn Код:
switch(JugadorInfo[playerid][jSexo])
{
    case 1: format(string, sizeof(string),"El medico %s estб de servicio.", NombreJugador(playerid));
    case 2: format(string, sizeof(string),"La medica %s estб de servicio.", NombreJugador(playerid));
}
SendClientMessageToAll(VERDE_OSCURO,string);
EntregarArma(playerid, 41, 350);
EnServicio[playerid] = 1;



Re: Variable de sexo - Glimma - 11.09.2012

їY con йsto?

pawn Код:
SendClientMessageToAll(AZUL, "|___________ Anuncio del Estado___________|");
                if(JugadorInfo[playerid][jAlcalde] == 1)
                {
                    format(string, sizeof(string), "Alcalde %s: %s", NombreJugador(playerid), result);
                    SendClientMessageToAll(BLANCO, string);
                }
                else if(JugadorInfo[playerid][jMiembro] == 1 || JugadorInfo[playerid][jLider] == 1)
                {
                    if(JugadorInfo[playerid][jLider] == 1) { format(string, sizeof(string), "Sheriff %s: %s", NombreJugador(playerid), result); }
                    SendClientMessageToAll(BLANCO, string);
                }
                else if(JugadorInfo[playerid][jMiembro] == 2 || JugadorInfo[playerid][jLider] == 2)
                {
                    if(JugadorInfo[playerid][jLider] == 2) { format(string, sizeof(string), "General %s: %s", NombreJugador(playerid), result); }
                    SendClientMessageToAll(BLANCO, string);
                }
                else if(JugadorInfo[playerid][jMiembro] == 3 || JugadorInfo[playerid][jLider] == 3)
                {
                    if(JugadorInfo[playerid][jLider] == 3) { format(string, sizeof(string), "Director Mйdico %s: %s", NombreJugador(playerid), result); }
                    SendClientMessageToAll(BLANCO, string);
                }
                else if(JugadorInfo[playerid][jMiembro] == 16 || JugadorInfo[playerid][jLider] == 16)
                {
                    if(JugadorInfo[playerid][jLider] == 16) { format(string, sizeof(string), "Alcalde %s: %s", NombreJugador(playerid), result); }
                    SendClientMessageToAll(BLANCO, string);
                }



Respuesta: Variable de sexo - WCrimson - 11.09.2012

pawn Код:
SendClientMessageToAll( 0xFF, ( format( string, sizeof string, ( JugadorInfo[para1][jSexo] == 1 ? ( #El mйdico %s esta de servicio.) : ( #La doctora %s esta de servicio.) ), NombreJugador( playerid ) ), string ) );
                        EntregarArma(playerid, 41, 350);
                        EnServicio[playerid] = 1;
EDIT#: No vi lo segundo.


Respuesta: Variable de sexo - Bu11Sh0t - 11.09.2012

pawn Код:
SendClientMessageToAll(AZUL, "|___________ Anuncio del Estado___________|");
new Sexo = JugadorInfo[playerid][jSexo], Nombre[20];
if(JugadorInfo[playerid][jAlcalde] == 1)
{
    if(Sexo == 1) Nombre = "Alcalde"; else Nombre = "Alcaldesa";
    format(string, sizeof(string), "%s %s: %s", Nombre, NombreJugador(playerid), result);
    SendClientMessageToAll(BLANCO, string);
}
else if(JugadorInfo[playerid][jMiembro] == 1 || JugadorInfo[playerid][jLider] == 1)
{
    if(Sexo == 1) Nombre = "Sheriff"; else Nombre = "Sheriff (Mujer)";
    if(JugadorInfo[playerid][jLider] == 1) { format(string, sizeof(string), "%s %s: %s", Nombre, NombreJugador(playerid), result); }
    SendClientMessageToAll(BLANCO, string);
}
else if(JugadorInfo[playerid][jMiembro] == 2 || JugadorInfo[playerid][jLider] == 2)
{
    if(Sexo == 1) Nombre = "General"; else Nombre = "Generala";
    if(JugadorInfo[playerid][jLider] == 2) { format(string, sizeof(string), "%s %s: %s", Nombre, NombreJugador(playerid), result); }
    SendClientMessageToAll(BLANCO, string);
}
else if(JugadorInfo[playerid][jMiembro] == 3 || JugadorInfo[playerid][jLider] == 3)
{
    if(Sexo == 1) Nombre = "Director Medico"; else Nombre = "Directora Medica";
    if(JugadorInfo[playerid][jLider] == 3) { format(string, sizeof(string), "%s %s: %s", Nombre, NombreJugador(playerid), result); }
    SendClientMessageToAll(BLANCO, string);
}
else if(JugadorInfo[playerid][jMiembro] == 16 || JugadorInfo[playerid][jLider] == 16)
{
    if(Sexo == 1) Nombre = "Alcalde"; else Nombre = "Alcaldesa";
    if(JugadorInfo[playerid][jLider] == 16) { format(string, sizeof(string), "%s %s: %s", Nombre, NombreJugador(playerid), result); }
    SendClientMessageToAll(BLANCO, string);
}
Fue lo que se me ocurrio, para que no hubiera tanto codigo...


Re: Variable de sexo - Glimma - 11.09.2012

Magnнfico.. +rep


Respuesta: Variable de sexo - Jhoel - 11.09.2012

Te aclaro que no existe una "Medica" como tal... sea hombre o mujer a ambos se le dice Medico, seria una falta de ortografнa colocar eso.