[Solved] How to make something only work for names? - 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: [Solved] How to make something only work for names? (
/showthread.php?tid=118501)
[Solved] How to make something only work for names? -
bajskorv123 - 03.01.2010
Hey!
Please help me out if you now how to do
I have some mins ago made a hq for myself with a timergate, my friend, [NWA]top has asked me to make a hq for him.
Now he isnt an admin so it wont be that easy like it was on my other gate. (If(isplayeradmin))
The question is, is there possible to make something work for names?
Like this:
Код:
if(strcmp("/topgate",cmd,true)==0)
{
if(name == [NWA]top)
{
SetTimer("OpenTopsGate",500,false);
return 1;
}
return 1;
}
If this is possible, please help me out, Please
Re: [Unsolved] How to make something only work for names? -
MadeMan - 03.01.2010
pawn Код:
if(strcmp("/topgate",cmd,true)==0)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(strcmp(playername, "[NWA]top") == 0)
{
SetTimer("OpenTopsGate",500,false);
return 1;
}
return 1;
}
Re: [Solved] How to make something only work for names? -
bajskorv123 - 03.01.2010
Ok if this hq was for 2 people, so 2 people can open the gate, would the script look like no. 1 or no. 2 or something else (Please
, post here)
Number 1:
Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(strcmp(playername, "[NWA]top" || "[NWA]WSD")==0)
{
SetTimer("OpenTopsGate",500,false);
return 1;
}
Number 2:
Код:
new playername[MAX_PLAYER_NAME];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(playerid, playername2, sizeof(playername2));
if(strcmp(playername, "[NWA]top")==0)
{
SetTimer("OpenTopsGate",500,false);
return 1;
}
if(strcmp(playername, "[NWA]WSD")==0)
{
SetTimer("OpenTopsGate",500,false);
return 1;
}
Thanks in advance
Re: [UnSolved] How to make something only work for names? -
MadeMan - 03.01.2010
pawn Код:
if(strcmp("/topgate",cmd,true)==0)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(strcmp(playername, "[NWA]top") == 0 || strcmp(playername, "[NWA]WSD") == 0)
{
SetTimer("OpenTopsGate",500,false);
return 1;
}
return 1;
}
Re: [Solved] How to make something only work for names? -
bajskorv123 - 03.01.2010
Thanks a lot! It works now! I'm really happy!
Thanks.