poner puertas solo facciones
#1

Losiento si soy pesado pero es porque aqui me ayudais muchisimo a gracias a todos
Quiero poner una puerta solo para facciones(policias) pero em da errores segun hhe leido en tutoriales os dejo una de las puertas a ver si me ayudais(las puertas van solo que las abre to dios)
Quote:

#include <a_samp>
#include <core>
#include <float>
#define verde 0x33AA33AA

new Puerta6;
new Puerta7;
new Puerta8;

public OnFilterScriptInit()
{
Puerta6 = CreateObject(1493, 250.75250244141, 61.779201507568, 1002.640625, 0, 0, 89.324493408203);
Puerta7 = CreateObject(1493, 250.71475219727, 64.817604064941, 1002.640625, 0.00000000000, 0.00000000000, 270.67370605469);
Puerta8 = CreateObject(974, 250.76702880859, 68.138221740723, 1006.1683349609, 0.00000000000, 89.325012207031, 270.67565917969);
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/ap1", cmdtext, true) == 0) //para abrir la puerta
{

if(IsPlayerInRangeOfPoint(playerid, 15.0, 250.75250244141, 61.779201507568, 1002.640625)){ //si el jugador no esta en un radio de 15.0 a la puerta no lo dejara usar el comando. (Reemplazar las coordenadas por las coordenadas de nuestra puerta (CERRADA))
MoveObject(Puerta6, 250.7060546875, 60.446472167969, 1002.640625, 3.0); //mueve nuestra puerta hasta las coordenadas de la puerta abierta. (Reemplazar las coordenadas por las coordenadas de nuestra puerta (ABIERTA))
MoveObject(Puerta7, 250.73263549805, 65.595016479492, 1002.640625, 3.0);
return SendClientMessage(playerid, 0x28F943FF, "Server: Has abierto la puerta");
}else return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Debes estar cerca de la puerta para usar este comando");
}

if (strcmp("/cp1", cmdtext, true) == 0) //cerrar
{

if(IsPlayerInRangeOfPoint(playerid, 15.0, 250.75250244141, 61.779201507568, 1002.640625)){ //si el jugador no esta en un radio de 15.0 a la puerta no lo dejara usar el comando. (Reemplazar las coordenadas por las coordenadas de nuestra puerta (CERRADA))
MoveObject(Puerta6, 250.75250244141, 61.779201507568, 1002.640625, 3.0); //mueve nuestra puerta hasta las coordenadas de la puerta abierta. (Reemplazar las coordenadas por las coordenadas de nuestra puerta (CERRADA))
MoveObject(Puerta7, 250.71475219727, 64.817604064941, 1002.640625, 3.0);
return SendClientMessage(playerid, 0x28F943FF, "Server: Has cerrado la puerta");
}else return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Debes estar cerca de la puerta para usar este comando");


}

Reply
#2

En el public OnPlayerCommandText, en cada comando necesitas colocarle, arriba de: IsPlayerInRangeOfPoint, agrega esto:

pawn Код:
if(PlayerInfo[playerid][pMember] == (Numero Faccion) || PlayerInfo[playerid][pLeader] == (Numero Faccion))
Ejemplo:
pawn Код:
if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10)
Reply
#3

aslo en pawn asi
Reply
#4

Quote:
Originally Posted by FelipekxD
En el public OnPlayerCommandText, en cada comando necesitas colocarle, arriba de: IsPlayerInRangeOfPoint, agrega esto:

pawn Код:
if(PlayerInfo[playerid][pMember] == (Numero Faccion) || PlayerInfo[playerid][pLeader] == (Numero Faccion))
Ejemplo:
pawn Код:
if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10)
Quote:

C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : warning 215: expression has no effect
C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#5

Quote:
Originally Posted by sergio3
Quote:
Originally Posted by FelipekxD
En el public OnPlayerCommandText, en cada comando necesitas colocarle, arriba de: IsPlayerInRangeOfPoint, agrega esto:

pawn Код:
if(PlayerInfo[playerid][pMember] == (Numero Faccion) || PlayerInfo[playerid][pLeader] == (Numero Faccion))
Ejemplo:
pawn Код:
if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10)
Quote:

C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : warning 215: expression has no effect
C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Propietario\Escritorio\RolePlay - By GroX0r - SA-MP\filterscripts\PUERTASLSPD.pwn(27) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Es que no tienes que ponerlo como un FS tienes que hacerlo dentro del GM. Sino las arrays no estбn declaradas.
Reply
#6

Correcto.

Te demorarбs un mundo en hacerlas en un FS, mientras que en 5 minutos la haces en el Gm (y ademas, te queda mas ordenado).
Reply
#7

en el gm no me va lo pongo ero al entrar no esta explicame en sf porfa

pd= (como quito el maldito sistema de heridas )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)