SA-MP Forums Archive
[ajuda]portao gang especifica - 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: [ajuda]portao gang especifica (/showthread.php?tid=216594)



[ajuda]portao gang especifica - maquerx - 25.01.2011

pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <a_objects>
//----------------------------------------------------------
new portaorussa;
forward PortaoRussa();

public OnGameModeInit()
{
    SetTimer("PortaoRussa", 200, true);
    portaorussa = CreateObject(980, 1287.5961914063, -2056.6650390625, 60.437160491943, 0, 0, 269.49462890625); //createobject do objecto que vocк criou para o portгo, quando for fazer faзa ele primeiro FECHADO
}
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)

{

new Float:oldposx, Float:oldposy, Float:oldposz;

new Float:tempposx, Float:tempposy, Float:tempposz;

GetPlayerPos(playerid, oldposx, oldposy, oldposz);

tempposx = (oldposx -x);

tempposy = (oldposy -y);

tempposz = (oldposz -z);

if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))

{

return 1;

}

return 0;

}

    public PortaoRussa(); { //nome do forward
    for(new i=0; i < MAX_PLAYERS(); i++)
    if( gTeam[i] == TEAM_COPS 15) { //gteam й a array que usei para setar a gang e TEAM_COPS й o id da gang/team
    if(PlayerToPoint(15, 980,1287.5961914063, -2056.6650390625, 60.437160491943)) { //o 15 й o raio que o player tem que ficar para abrir o portгo, depois do i sгo as coordenadas do portгo fexado, a mesma do create object
    MoveObject(portaorussa,1287.6038818359, -2056.4663085938,20.547, 2); // funзгo para mover o objecto, nesse exemplo faremos o portгo subir para cima, no eixo Z que й a ultima coordenada(20.547) e o 2 й a velocidade que ele se vai mover.
    MoveObject(portaocop,1287.5961914063, -2056.6650390625, 12.547, 2); //se o player se afastar do portгo atй nгo estar mais no raio definido, o portгo vai mover se para baixo(eixo Z, coordenada 12.547)
}
}
}
}
C:\Samp\filterscripts\portaoauto.pwn(12) : error: 076: syntax error in the expression, or invalid function call
C:\Samp\filterscripts\portaoauto.pwn(12) : error: 055: start of function body without function header
C:\Samp\filterscripts\portaoauto.pwn(12) : error: 010: invalid function or declaration
C:\Samp\filterscripts\portaoauto.pwn(12) : error: 010: invalid function or declaration
C:\Samp\filterscripts\portaoauto.pwn(12) : error: 010: invalid function or declaration
C:\Samp\filterscripts\portaoauto.pwn(12) : warning: 203: symbol is never used: "portaorussa"

ajuda ae


Re: [ajuda]portao gang especifica - [FeK]Knife - 25.01.2011

public OnGameModeInit()
{
SetTimer("PortaoRussa", 200, true);
portaorussa = CreateObject(980, 1287.5961914063, -2056.6650390625, 60.437160491943, 0, 0, 269.49462890625);
return 1;
}

public PortaoRussa()
{
for(new i=0; i < MAX_PLAYERS(); i++)
{
if( gTeam[i] == TEAM_COPS 15)
{
if(PlayerToPoint(15, 980,1287.5961914063, -2056.6650390625, 60.437160491943))
{
MoveObject(portaorussa,1287.6038818359, -2056.4663085938,20.547, 2);
MoveObject(portaocop,1287.5961914063, -2056.6650390625, 12.547, 2);
}
}
}
}


Respuesta: [ajuda]portao gang especifica - maquerx - 25.01.2011

pawn Код:
new portaorussa;
forward PortaoRussa();

public OnGameModeInit()
{
SetTimer("PortaoRussa", 200, true);
portaorussa = CreateObject(980, 1287.5961914063, -2056.6650390625, 60.437160491943, 0, 0, 269.49462890625);
return 1;
}

public PortaoRussa()
{
for(new i=0; i < MAX_PLAYERS(); i++)

{
if( gTeam[i] == TEAM_COPS 15)
{
if(PlayerToPoint(15, 980,1287.5961914063, -2056.6650390625, 60.437160491943))
{
MoveObject(portaorussa,1287.6038818359, -2056.4663085938,20.547, 2);
MoveObject(portaocop,1287.5961914063, -2056.6650390625, 12.547, 2);
}
}
}
}
C:\Samp\filterscripts\portaoauto.pwn(1 : error: 029: invalid expression, assumed zero
C:\Samp\filterscripts\portaoauto.pwn(1 : error: 001: expected token: ")", but found ";"
C:\Samp\filterscripts\portaoauto.pwn(1 : error: 001: expected token: ";", but found ")"
C:\Samp\filterscripts\portaoauto.pwn(1 : error fatal: 107: too many error messages on one line
sera q ta faltando include?


Re: [ajuda]portao gang especifica - ManoLexuS - 26.01.2011

Tente trocando isso:
pawn Код:
if( gTeam[i] == TEAM_COPS 15)
por isso:
pawn Код:
if( gTeam[i] == TEAM_COPS)
Acho que й isso, espero ter ajudado.

@EDIT:

Oq seria aquele "980" no PlayerToPoint? Seria o 'playerid' certo? Se for coloque i no lugar do 980.

Entгo ficaria assim:
pawn Код:
if(PlayerToPoint(15, i,1287.5961914063, -2056.6650390625, 60.437160491943))
@EDITІ:

Troque isso:
pawn Код:
for(new i=0; i < MAX_PLAYERS(); i++)
Por isso:
pawn Код:
for(new i=0; i < MAX_PLAYERS; i++)



Respuesta: [ajuda]portao gang especifica - maquerx - 26.01.2011

continua dando erro acho q й melhor refazer tudo, se alguem tiver um tuto q realmente funfe


Re: [ajuda]portao gang especifica - Magnus' - 26.01.2011

http://forum.sa-mp.com/showthread.ph...E3o+abre+fecha