Hola, ayuda con esto - 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: Hola, ayuda con esto (
/showthread.php?tid=458438)
Hola, ayuda con esto -
adrianxd - 16.08.2013
Estoy creando un de zombies etc
Bueno lo que pasa es que cuando quiero hacer el user infected no me cambia a ese usuario a el team zombie.
pawn Код:
forward UpdateTime(playerid);
public UpdateTime(playerid)
{
new Str[34];
TimeS --;
if(TimeM == 0 && TimeS == 0)
{
KillTimer(Time);
}
if(TimeS == -1)
{
TimeM--;
TimeS = 59;
}
format(Str, sizeof(Str), " %02d:%02d", TimeM, TimeS);
TextDrawSetString(conteo1, Str);
if(TimeS == 0)
{
TextDrawHideForAll(conteo1);
TextDrawHideForAll(conteo);
RandomPlayer(playerid);
}
return 1;
}
public RandomPlayer(playerid)//Aqui ayuda a seleccionar un usuario para el team ZOMBIE
{
new string[256];
new randomplayer = GetRandomPlayer();
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "***The user: {00ff01}--.:[%s]:.-- {00ffff}has become a {FF0000}zombie kill him***", sendername);
SendClientMessageToAll(0x00ffffff,string);
if(gTeam[playerid] == TEAM_ZOMBIE) // esta parte no me esta funcionando no me hace el cambio del team 0 al 1
{
SetPlayerTeam(playerid,1);
GivePlayerWeapon(playerid,9,1);
SetPlayerSkin(playerid,163);
}
return 1;
}
//============================================================================//
stock GetRandomPlayer()
{
new playaz[MAX_PLAYERS], count;
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
playaz[count] = i;
count++;
}
}
return playaz[random(count)];
}
Esta es la parte la que no me funciona "manda el mesage pero no hace q pase el user del team 0 al 1 que es el zombie
pawn Код:
public RandomPlayer(playerid)//Aqui ayuda a seleccionar un usuario para el team ZOMBIE
{
new string[256];
new randomplayer = GetRandomPlayer();
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "***The user: {00ff01}--.:[%s]:.-- {00ffff}has become a {FF0000}zombie kill him***", sendername);
SendClientMessageToAll(0x00ffffff,string);
if(gTeam[playerid] == TEAM_ZOMBIE) // esta parte no me esta funcionando no me hace el cambio del team 0 al 1
{
SetPlayerTeam(playerid,1);
GivePlayerWeapon(playerid,9,1);
SetPlayerSkin(playerid,163);
}
return 1;
}
Respuesta: Hola, ayuda con esto -
WCrimson - 16.08.2013
En ningъn momento se observa que estes modificando el valor de 'gTeam' para el usuario.
Sн el team 1 es ZOMBIES, y el usuario pertenece al team 0 ese if no se cumplirб.
pawn Код:
gTeam[playerid] = TEAM_ZOMBIE;
if(gTeam[playerid] == TEAM_ZOMBIE) // Asн este if se cumplirб.
{
SetPlayerTeam(playerid,1);
GivePlayerWeapon(playerid,9,1);
SetPlayerSkin(playerid,163);
}
Respuesta: Hola, ayuda con esto -
adrianxd - 16.08.2013
ah lol, jajaja apenas veo ese error mio -.-, ya lo testie y funciono gracias "Olvide la mayorнa del script :B"
Gracias Saludos.