05.03.2011, 22:39
Hey everyone,
First of all sorry for my bad english.
I try to include a script for a samp serv that's open the gates that are mapped. But it won't work.
Here is the script code. I mapped two gates, one opened and one closed.
new obj1;
public OnFilterScriptInit()
{
obj1 = CreateObject(976, 2485.6479492188, 2350.5834960938, 9.8281135559082, 0, 0, 180); //barriere FBI Fermer
return 1;
}
public OnGameModeInit()
{
CreateObject(976, 2485.6479492188, 2350.5834960938, 9.8281135559082, 0, 0, 180); //barriere FBI Fermer
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/opfbi", cmdtext, true)==0)
{
MoveObject(obj1,2485.6479492188, 2350.5834960938, 9.8281135559082, 6.5);
SetTimer("GateClose", 15000, 0);
SendClientMessage(playerid, COLOR_PURPLE,"FBI GATE OPENING - CLOSING IN 15 SECONDS");
return 1;
}
return 0;
}
public GateClose()
{
MoveObject (obj1,2485.6479492188, 2350.5834960938, 9.8281135559082, 3.5);
return 1;
}
Can anyone help me?
Thanks
First of all sorry for my bad english.
I try to include a script for a samp serv that's open the gates that are mapped. But it won't work.
Here is the script code. I mapped two gates, one opened and one closed.
new obj1;
public OnFilterScriptInit()
{
obj1 = CreateObject(976, 2485.6479492188, 2350.5834960938, 9.8281135559082, 0, 0, 180); //barriere FBI Fermer
return 1;
}
public OnGameModeInit()
{
CreateObject(976, 2485.6479492188, 2350.5834960938, 9.8281135559082, 0, 0, 180); //barriere FBI Fermer
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/opfbi", cmdtext, true)==0)
{
MoveObject(obj1,2485.6479492188, 2350.5834960938, 9.8281135559082, 6.5);
SetTimer("GateClose", 15000, 0);
SendClientMessage(playerid, COLOR_PURPLE,"FBI GATE OPENING - CLOSING IN 15 SECONDS");
return 1;
}
return 0;
}
public GateClose()
{
MoveObject (obj1,2485.6479492188, 2350.5834960938, 9.8281135559082, 3.5);
return 1;
}
Can anyone help me?
Thanks