How to? - 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? (
/showthread.php?tid=85058)
How to? -
SkyWinder - 05.07.2009
How to make my gate only open with players with _test behind their names like
1_test
2_test
5_test
atm i got
Код:
if (strcmp(cmdtext, "/ogate", true)==0)
{
new pName[24]; GetPlayerName(playerid, pName, 24);
if (!strcmp(pName, "_test", true))
{
MoveStreamObject(test, -2443.229004, 491.982147, 30.627890, 2.500000);
MoveStreamObject(test1, -2423.760254, 500.450073, 30.631317, 2.500000);
SetTimer("Close", 7000, 0);
SendClientMessage(playerid, COLOR_YELLOW, "Indentity corfimed. The Enctrance Door is opening.");
} else return SendClientMessage(playerid, COLOR_GRAD3, "Wrong indentity.");
return 1;
Re: How to? -
abhinavdabral - 05.07.2009
This will work for that.
Код:
if (strcmp(cmdtext, "/ogate", true)==0)
{
new pName[24]; GetPlayerName(playerid, pName, 24);
new Tag[24];
strmid(Tag,pName,strlen(pName)-5,strlen(pName),24);
if (!strcmp(Tag, "_test", true))
{
MoveStreamObject(test, -2443.229004, 491.982147, 30.627890, 2.500000);
MoveStreamObject(test1, -2423.760254, 500.450073, 30.631317, 2.500000);
SetTimer("Close", 7000, 0);
SendClientMessage(playerid, COLOR_YELLOW, "Indentity corfimed. The Enctrance Door is opening.");
} else return SendClientMessage(playerid, COLOR_GRAD3, "Wrong indentity.");
return 1;
Re: How to? -
SkyWinder - 05.07.2009
it still gives me wrong identity
Re: How to? -
Nero_3D - 05.07.2009
Try that
pawn Код:
if (strcmp(cmdtext, "/ogate", true)==0)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
if (pName[(strfind(pName, "_test", true, 1) + 5)] == EOS)
{
MoveStreamObject(test, -2443.229004, 491.982147, 30.627890, 2.500000);
MoveStreamObject(test1, -2423.760254, 500.450073, 30.631317, 2.500000);
SetTimer("Close", 7000, 0);
SendClientMessage(playerid, COLOR_YELLOW, "Indentity corfimed. The Enctrance Door is opening.");
}
else SendClientMessage(playerid, COLOR_GRAD3, "Wrong indentity.");
return 1;
}
Re: How to? -
SampFreak09 - 23.07.2009
When i Try Making This, It Says Undefined Symbol, "MoveStreamObject" What Do I Do??
Re: How to? -
cloud9 - 23.07.2009
just make the Door objects with CreateObject and use MoveObject instead of movestreamobject