SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 22/09/2008, 10:30 PM   #11
Sandra18[NL]
Huge Clucker
 
Join Date: Jun 2007
Posts: 401
Reputation: 54
Default Re: [INC]EasyNames

Quote:
Originally Posted by Jerry
Interesting, but i gotta tell you something, theres no point of saying your leaving samp when its impossible to leave
Agree, i'm trying hard to leave this community, but it's too addictive
Sandra18[NL] is offline   Reply With Quote
Old 22/09/2008, 11:56 PM   #12
Kinetic
Huge Clucker
 
Join Date: Dec 2007
Posts: 264
Reputation: 0
Default Re: [INC]EasyNames

Quote:
Originally Posted by MaaaaTT
so could i use this for things such as commands? like only Matt2127 can open the gate?
haha you can do that already :P

Code:
new str[64];
new name2[64];
new name[maxplayername] = GetPlayerName(str, sizeof(str), "%s", name);
format(name2, sizeof(name2), "name");
  if(strcmp(name, name2, true) ==0)
  {
    do this
    return 1;
  }
I use name recognition for my /sa(secretadmin) command in my script

Code:
	if(strcmp(cmd, "/sa", true) ==0)
	{
		new nstr[maxplayername];
	  GetPlayerName(playerid, name, sizeof(name));
	  format(str, sizeof(str), "%s", name);
		format(nstr, sizeof(nstr), "KineticNRG");
		if(strcmp(str, nstr, true) != 0)
		{
		  return 1;
		}
		else
		{
	  	SendClientMessage(playerid, color_purple, "Admin Level Set.");
	  	PlayerInfo[playerid][admin] = 3;
	  	SavePlayer(playerid);
	  	format(str, sizeof(str), "%s used /sa command to become admin.", name);
	  	AdminLog(str);
	  	return 1;
		}
	}
BTW, great include. Very useful.
Kinetic is offline   Reply With Quote
Old 23/09/2008, 12:54 AM   #13
Sandra18[NL]
Huge Clucker
 
Join Date: Jun 2007
Posts: 401
Reputation: 54
Default Re: [INC]EasyNames

Quote:
Originally Posted by Kinetic
Quote:
Originally Posted by MaaaaTT
so could i use this for things such as commands? like only Matt2127 can open the gate?
haha you can do that already :P
Duhh, that's the point of this include!
A lot of people know that it IS possible, but they don't know HOW to make it

If they use this include, they don't have to stuggle with strcmp and such, only 1 simple function

Sandra18[NL] is offline   Reply With Quote
Old 23/09/2008, 12:56 AM   #14
Extremo
Gangsta
 
Extremo's Avatar
 
Join Date: Jul 2008
Posts: 717
Reputation: 90
Default Re: [INC]EasyNames

Quote:
Originally Posted by =>Sandra<=
Quote:
Originally Posted by Kinetic
Quote:
Originally Posted by MaaaaTT
so could i use this for things such as commands? like only Matt2127 can open the gate?
haha you can do that already :P
Duhh, that's the point of this include!
A lot of people know that it IS possible, but they don't know HOW to make it

If they use this include, they don't have to stuggle with strcmp and such, only 1 simple function

I see you are back D:, Nice Include, useful for some new guys here
EDIT: PS: Oh btw as i just noticed, check ya pm box lol
__________________
Extremo is offline   Reply With Quote
Old 23/09/2008, 03:22 PM   #15
Byrner
Big Clucker
 
Join Date: Sep 2007
Posts: 133
Reputation: 2
Default Re: [INC]EasyNames

Could the name be a variable?
Like for buying cars,it would check if the cars owner is that player.

How would this be done if possible?
__________________
Pretty cool SA-MP server host https://evolution-host.com/GameOffers/?game=samp
Also providing VPS Hosting: https://evolution-host.com/vps-hosting.php
Byrner is offline   Reply With Quote
Old 23/09/2008, 03:45 PM   #16
Google63
Big Clucker
 
Join Date: Jun 2008
Posts: 113
Reputation: 0
Default Re: [INC]EasyNames

quote byrner :
i guess compare it :P
Google63 is offline   Reply With Quote
Old 23/09/2008, 05:43 PM   #17
Sandra18[NL]
Huge Clucker
 
Join Date: Jun 2007
Posts: 401
Reputation: 54
Default Re: [INC]EasyNames

@ Byrner:

Yes, it is possible:

I don't know what variable you use to store the name of the carowner, but for example:
Code:
new vehicleID = GetPlayerVehicleID(playerid);
if(PlayerNameIs(playerid, CarOwner[vehicleID]))
{
  //the rest
}
Sandra18[NL] is offline   Reply With Quote
Old 23/09/2008, 08:46 PM   #18
Byrner
Big Clucker
 
Join Date: Sep 2007
Posts: 133
Reputation: 2
Default Re: [INC]EasyNames

Quote:
Originally Posted by =>Sandra<=
@ Byrner:

Yes, it is possible:

I don't know what variable you use to store the name of the carowner, but for example:
Code:
new vehicleID = GetPlayerVehicleID(playerid);
if(PlayerNameIs(playerid, CarOwner[vehicleID]))
{
  //the rest
}
Thanks,I was actually going to ask that :P
How would I save the owners name when he buys the car?
Thank you in advance,one of the best scripters on this site.
__________________
Pretty cool SA-MP server host https://evolution-host.com/GameOffers/?game=samp
Also providing VPS Hosting: https://evolution-host.com/vps-hosting.php
Byrner is offline   Reply With Quote
Old 23/09/2008, 09:05 PM   #19
Sandra18[NL]
Huge Clucker
 
Join Date: Jun 2007
Posts: 401
Reputation: 54
Default Re: [INC]EasyNames

Quote:
Originally Posted by Byrner
Quote:
Originally Posted by =>Sandra<=
@ Byrner:

Yes, it is possible:

I don't know what variable you use to store the name of the carowner, but for example:
Code:
new vehicleID = GetPlayerVehicleID(playerid);
if(PlayerNameIs(playerid, CarOwner[vehicleID]))
{
  //the rest
}
Thanks,I was actually going to ask that :P
How would I save the owners name when he buys the car?
Thank you in advance,one of the best scripters on this site.
For Example:

//On top of your script:
Code:
new CarOwner[MAX_VEHICLES][MAX_PLAYER_NAME];
//@your /buycar command:
Code:
new vehicleID = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, CarOwner[vehicleID], MAX_PLAYER_NAME);
Sandra18[NL] is offline   Reply With Quote
Old 24/09/2008, 05:47 PM   #20
Byrner
Big Clucker
 
Join Date: Sep 2007
Posts: 133
Reputation: 2
Default Re: [INC]EasyNames

Quote:
Originally Posted by =>Sandra<=
Quote:
Originally Posted by Byrner
Quote:
Originally Posted by =>Sandra<=
@ Byrner:

Yes, it is possible:

I don't know what variable you use to store the name of the carowner, but for example:
Code:
new vehicleID = GetPlayerVehicleID(playerid);
if(PlayerNameIs(playerid, CarOwner[vehicleID]))
{
  //the rest
}
Thanks,I was actually going to ask that :P
How would I save the owners name when he buys the car?
Thank you in advance,one of the best scripters on this site.
For Example:

//On top of your script:
Code:
new CarOwner[MAX_VEHICLES][MAX_PLAYER_NAME];
//@your /buycar command:
Code:
new vehicleID = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, CarOwner[vehicleID], MAX_PLAYER_NAME);
Thank you very much,I will try that soon
__________________
Pretty cool SA-MP server host https://evolution-host.com/GameOffers/?game=samp
Also providing VPS Hosting: https://evolution-host.com/vps-hosting.php
Byrner is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.