Need help with my Mod - 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: Need help with my Mod (
/showthread.php?tid=92210)
Need help with my Mod -
david_d8 - 18.08.2009
Hello everybody

I would like to know if you can do that only players with certain names
could use certain commands
Thanks alot
Re: Need help with my Mod -
Eazy_Efolife - 18.08.2009
SA-MP doesnt support mods
Re: Need help with my Gmemode -
david_d8 - 18.08.2009
I mean with my Gamemode
Re: Need help with my Mod -
Eazy_Efolife - 18.08.2009
You Mean Like Only Certain People could do Commands... Like Admins
Only Admins can do /kick
or like only Cops and do /arrest
Like That?
Re: Need help with my Mod -
Correlli - 18.08.2009
Quote:
Originally Posted by Compton's Eazy E
SA-MP doesnt support mods
|
He's talking about script..
Quote:
Originally Posted by david_d8
Hello everybody 
I would like to know if you can do that only players with certain names
could use certain commands
Thanks alot 
|
Yes, it is. You would need to use
GetPlayerName function to get player's name and
strcmp to compare if the name-string is the same as the string you're checking but don't forget that strcmp will return 0 if the strings are the same (same goes if one of the strings is empty).
Re: Need help with my Mod -
david_d8 - 18.08.2009
Yeha.
I have a command that ony admin with rcon can use.
i have admin with Admin mode access and without rcon.
Understand?
Re: Need help with my Mod -
Eazy_Efolife - 18.08.2009
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Compton's Eazy E
SA-MP doesnt support mods
|
He's talking about script..
Quote:
Originally Posted by david_d8
Hello everybody 
I would like to know if you can do that only players with certain names
could use certain commands
Thanks alot 
|
Yes, it is. You would need to use GetPlayerName function to get player's name and strcmp to compare if the name-string is the same as the string you're checking but don't forget that strcmp will return 0 if the strings are the same (same goes if one of the strings is empty).
|
My Bad.... Again
Re: Need help with my Mod -
david_d8 - 18.08.2009
Here i made this script
Код:
if(strcmp(cmdtext, "/Test", true) == 0){
if (IsPlayerConnected(playerid) == 1){
}
new Nick1[]="David";
GetPlayerName(playerid, sendername, sizeof(sendername));
if(strcmp(sendername,Nick1,false, sizeof(Nick1))==0){
SetPlayerPos(playerid,1293.2600,2523.5144,10.6719);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Access!");
}else{
SendClientMessage(playerid,COLOR_RED,"Not access!");
}
return 1;
}
but, i want to add another person how can i do that ?
Re: Need help with my Mod -
Correlli - 18.08.2009
In
if statement, use || character (OR) and add another strcmp-name-compare.
Re: Need help with my Mod -
david_d8 - 18.08.2009
I dont know how can you help me ?