SA-MP Forums Archive
How to moveable gate only for FBI faction? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to moveable gate only for FBI faction? (/showthread.php?tid=250151)



How to moveable gate only for FBI faction? - Aizen - 22.04.2011

how to script moveable gate only for FBI faction?


Re: How to moveable gate only for FBI faction? - [ADC]Aldi96 - 22.04.2011

Contact with Big Sa-mp Scripters and pay their to make your script men!!
Thnks~


Re: How to moveable gate only for FBI faction? - Max_Coldheart - 22.04.2011

pawn Код:
if(PlayerInfo[playerid][pFaction] == 2) //Usually FBI ID
code under it.


Re: How to moveable gate only for FBI faction? - Aizen - 22.04.2011

Under what?under OnPlayerCommandText?


Re: How to moveable gate only for FBI faction? - Max_Coldheart - 22.04.2011

in your cmd


Re: How to moveable gate only for FBI faction? - Aizen - 22.04.2011

Show me that script please,sorry iam just kinda noob scripter


Re: How to moveable gate only for FBI faction? - Markx - 22.04.2011

show us your move gate cmd


Re: How to moveable gate only for FBI faction? - Aizen - 22.04.2011

OK this is my pawno script

Quote:

#include <a_samp>

new gate;
new gateopen;


public OnFilterScriptInit()
{
gate = CreateObject(971, 1761.6020507813, -1700.5047607422, 12.527051925659, 0, 0, 269.99996948242);
CreateObject(980, 1804.2659912109, -1721.1015625, 13.306594848633, 0, 0, 35;
CreateObject(971, 1761.1508789063, -1691.0541992188, 12.497447967529, 0, 0, 269.99450683594);

return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], tmp[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/fbi", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /fbi [code]");
return 1;
}
new code;
code = strval(tmp);
if(code == 123)
{
if(IsPlayerInRangeOfPoint(playerid, 9.2, 1761.6015625, -1700.50390625, 7.5270519256592))
{
if(!gateopen)
{
MoveObject(gate, 1761.6015625, -1700.50390625, 7.5270519256592, 1.5);
gateopen = 1;
return 1;
}
else
{
MoveObject(gate, 1761.6020507813, -1700.5047607422, 12.527051925659, 1.5);
gateopen = 0;
return 1;
}
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, " You are not near a gate !");
return 1;
}
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, " Incorrect code !");
}
return 1;
}
return 0;
}

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}