SA-MP Forums Archive
/gateopen PD only - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /gateopen PD only (/showthread.php?tid=402961)



/gateopen PD only - Andrei0427 - 28.12.2012

Quote:

#include <a_samp>
new Gate;

public OnFilterScriptInit()
{
Gate = CreateObject(968, 1540.13, -1611.08, 12.94, 0.0, 88.42, 90.00, 100.0);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/gateopen", true)){
if(IsPlayerInRangeOfPoint(playerid, 15.0, 1540.13, -1611.08, 12.94)){
SetTimerEx("CloseGate", 7000, false, "i", playerid);
MoveObject(Gate, 1540.13, -1611.08, 12.94, 3.0, 0.0, 0.0, 90.00);
return 1;
}
}
return 0;
}

forward CloseGate(playerid);
public CloseGate(playerid)
{
MoveObject(Gate, 1540.13, -1611.08, 12.94, 3.0, 0.0, 88.42, 90.00);
}

I want that door can open only PD


Re: /gateopen PD only - Magic_Time - 28.12.2012

PHP код:
public OnGameModeInit()
{
new 
Gate;
public 
OnFilterScriptInit()
{
Gate CreateObject(9681540.13, -1611.0812.940.088.4290.00100.0);
return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
if(!
strcmp(cmdtext"/gateopen"true)){
if(
PlayerInfo[playerid][PD] == 1) return SendClientMessage(playerid, -1"You need to be PD");
if(
IsPlayerInRangeOfPoint(playerid15.01540.13, -1611.0812.94)){
SetTimerEx("CloseGate"7000false"i"playerid);
MoveObject(Gate1540.13, -1611.0812.943.00.00.090.00);
return 
1;
}
}
return 
0;




Re: /gateopen PD only - Andrei0427 - 28.12.2012

Quote:

C:\Documents and Settings\Anonim\Desktop\p.pwn(3) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Documents and Settings\Anonim\Desktop\p.pwn(5) : error 017: undefined symbol "CreateObject"
C:\Documents and Settings\Anonim\Desktop\p.pwn(9) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")
C:\Documents and Settings\Anonim\Desktop\p.pwn(11) : error 017: undefined symbol "strcmp"
C:\Documents and Settings\Anonim\Desktop\p.pwn(12) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Anonim\Desktop\p.pwn(12) : warning 215: expression has no effect
C:\Documents and Settings\Anonim\Desktop\p.pwn(12) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Anonim\Desktop\p.pwn(12) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Anonim\Desktop\p.pwn(12) : fatal error 107: too many error messages on one line

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


6 Errors.

I did a FS with it and not go


Re: /gateopen PD only - Diorturato - 28.12.2012

Man, we can't know which mode u are using.