SA-MP Forums Archive
Only gates goes open on the name. - 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: Only gates goes open on the name. (/showthread.php?tid=175640)



Only gates goes open on the name. - Derksen123 - 10.09.2010

i know how to make objects moveable , But how to make it that a gate only goes open on name Like only Jack_Freeman can open this gate.?


Re: Only gates goes open on the name. - LarzI - 10.09.2010

pawn Код:
new
    pName[ 24 ];
GetPlayerName( playerid, pName, 24 );
if( !strcmp( pName, "Jack_Freeman" ))
{
    //if name = Jack_Freeman
}
else
{
    //if not
}



Re: Only gates goes open on the name. - Derksen123 - 10.09.2010

so if you have it like this:
//--------------------------------------[john]------------------------------------------------------
if (strcmp(cmdtext, "/gopen", true)==0)
{
MoveObject (G,3116.862793, -229.258911, 4.043386,2.5);
return 1;
}
if (strcmp(cmdtext, "/gclose", true)==0)
{
MoveObject (G,3116.862793, -229.258911, -10.043386,2.5);
return 1;
}



How to edit it than?


Re: Only gates goes open on the name. - DeathOnaStick - 10.09.2010

Quote:
Originally Posted by Derksen123
Посмотреть сообщение
so if you have it like this:
//--------------------------------------[john]------------------------------------------------------
if (strcmp(cmdtext, "/gopen", true)==0)
{
MoveObject (G,3116.862793, -229.258911, 4.043386,2.5);
return 1;
}
if (strcmp(cmdtext, "/gclose", true)==0)
{
MoveObject (G,3116.862793, -229.258911, -10.043386,2.5);
return 1;
}



How to edit it than?
pawn Код:
if (strcmp(cmdtext, "/gopen", true)==0)
{
new
    pName[ 24 ];
GetPlayerName( playerid, pName, 24 );
if( !strcmp( pName, "Jack_Freeman" ))
{
   MoveObject (G,3116.862793, -229.258911, 4.043386,2.5);
}
}
pawn Код:
if (strcmp(cmdtext, "/gclose", true)==0)
{
new
    pName[ 24 ];
GetPlayerName( playerid, pName, 24 );
if( !strcmp( pName, "Jack_Freeman" ))
{
  MoveObject (G,3116.862793, -229.258911, -10.043386,2.5);
}
}
Thats all. Have fun.


Re: Only gates goes open on the name. - Derksen123 - 10.09.2010

Thank you guys