SA-MP Forums Archive
Comando equipo - 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: Comando equipo (/showthread.php?tid=298524)



Comando equipo - chucho - 21.11.2011

hola bueno quiero saber que linea de codigo utilizo para que mas de 1 equipo pueda ocupar el comando es decir

y que codigo utilizo para que en vez de que diga "**Necesitas estar ser equipo NOMBRE EQUIPO para usar este comando**"

EJEMPLO"**Necesitas estar ser equipo TEAM_GREEN para usar este comando**"


pawn Код:
if(!strcmp(cmdtext,"/comando",true))
    {
        if (gTeam[playerid] !=  TEAM_GREEN )
        {
        SendClientMessage(playerid, COLOR_RED, "**Necesitas estar ser equipo X para usar este comando**");;
        return 1;
        }
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid, 0);
        return 1;
    }



Respuesta: Comando equipo - [J]ulian - 21.11.2011

pawn Код:
if (gTeam[playerid] !=  TEAM_GREEN && gTeam[playerid] !=  TEAM_2)



Respuesta: Comando equipo - chucho - 21.11.2011

Quote:
Originally Posted by [J]ulian
Посмотреть сообщение
pawn Код:
if (gTeam[playerid] !=  TEAM_GREEN && gTeam[playerid] !=  TEAM_2)
Gracias oye y para sacar el nombre del equipo que codigo es?


Respuesta: Comando equipo - [J]ulian - 21.11.2011

El nombre del equipo? Si no lo almacenas en alguna variable no podйs. Si querйs el nъmero, GetPlayerTeam ( Obviamente tenйs que usar SetPlayerTeam para que esta funciуn sirva. )


Respuesta: Comando equipo - TiNcH010 - 21.11.2011

Para enviar el mensaje del nombre del equipo no podйs usar SendClientMessage solamente.
Tenes que usar format.

pawn Код:
new equipos[128];
format(equipos, sizeof(equipos), "**Necesitas estar ser equipo %s para usar este comando**", GetPlayerTeam); // Como dijo [J]ulian o sino la segunda opciуn.
SendClientMessage(playerid, COLOR_RED, equipos);
pawn Код:
new nequipo[128];
if(gTeam[playerid] == TEAM_GREEN) { nequipo = "Equipo Verde"; } // Modificar.
else { nequipo= "Ningъn Equipo"; }

new equipos[128];
format(equipos, sizeof(equipos), "**Necesitas estar ser equipo %s para usar este comando**", nequipo);
SendClientMessage(playerid, COLOR_RED, equipos);