Need help with my Mod
#1

Hello everybody
I would like to know if you can do that only players with certain names
could use certain commands
Thanks alot
Reply
#2

SA-MP doesnt support mods
Reply
#3

I mean with my Gamemode
Reply
#4

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?
Reply
#5

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).
Reply
#6

Yeha.
I have a command that ony admin with rcon can use.
i have admin with Admin mode access and without rcon.
Understand?
Reply
#7

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
Reply
#8

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 ?
Reply
#9

In if statement, use || character (OR) and add another strcmp-name-compare.
Reply
#10

I dont know how can you help me ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)