Base help! - 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: Base help! (
/showthread.php?tid=83930)
Base help! -
R3flex - 27.06.2009
Hello guys,
I've made a base for in my server
but i dont know how to add a command to open the doors
Example:
My name is: [UR]r3flex and only players of [UR] can open the door
by typing: /uropen /urclose
when they type: /uropen the way blockade goes down and they can drive into the base
and when they type /urclose the blockade goes up and no one can come in
I hope u understand it
Thanks!
Re: Base help! -
dice7 - 27.06.2009
pawn Код:
stock PlayerNameStartsWith(playerid, const name[])
{
if(IsPlayerConnected(playerid))
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(strfind(pName, name, true)==0)
{
return 1;
}
}
return 0;
}
Use it as
pawn Код:
if (PlayerNameStartsWith(playerid, "[UR]"))
{
}
Re: Base help! -
R3flex - 27.06.2009
Quote:
Originally Posted by dice7
pawn Код:
stock PlayerNameStartsWith(playerid, const name[]) { if(IsPlayerConnected(playerid)) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(strfind(name, name, true)==0) { return 1; } } return 0; }
Use it as
pawn Код:
if (PlayerNameStartsWith(playerid, "[UR]")) {
}
|
i am a noob so where do i have to add it and where do i have to put the commands?
Re: Base help! -
pascallj - 27.06.2009
Also remember that when people make his nickname [UR].... they can always enter...
Re: Base help! -
R3flex - 27.06.2009
Quote:
Originally Posted by pascallj
Also remember that when people make his nickname [UR].... they can always enter...
|
yeh but they need Permission to change their nickname

and we have always admins online for unwanted visitors.