SA-MP Forums Archive
Clan check? - 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: Clan check? (/showthread.php?tid=87105)



Clan check? - stieben - 18.07.2009

Hello,

Is there any way to check if a player is in a clan/gang? I don't want to check if the name of the player is right, example: [GTA]Stieben, but I want it to be in a file so the script checks it.

I hope you know what I want, because my english is not optimal.


Re: Clan check? - refshal - 18.07.2009

pawn Код:
public OnPlayerConnect(playerid)
{
new PlayerName[MAX_PLAYER_NAME];
new File:file;
new string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "[GTA]");
if(strcmp(PlayerName, string, true) == 0)
{
fwrite(file, PlayerName);
return 1;
}
fclose(file);
return 1;
}



Re: Clan check? - Weirdosport - 18.07.2009

@:eddy

Rather than creating the string "string" and formatting it, why not do this:

if(strcmp(PlayerName, "[GTA]", true) == 0)


Re: Clan check? - stieben - 18.07.2009

Thanks, but is there also a way to put in a file that the name Stieben belonges to the [GTA] clan?



Re: Clan check? - refshal - 18.07.2009

Quote:
Originally Posted by Weirdosport
@:eddy

Rather than creating the string "string" and formatting it, why not do this:

if(strcmp(PlayerName, "[GTA]", true) == 0)
You might have a point. I didn't really thought about that... lol


Re: Clan check? - stieben - 18.07.2009

What I mean is the name Stieben is green and that is the color of the [GTA] clan. Everyone that is green is in the [GTA] clan. I hope someone can help me now


Re: Clan check? - stieben - 18.07.2009

btw, that code is not working either


Re: Clan check? - stieben - 18.07.2009

Come on I really need this


Re: Clan check? - refshal - 18.07.2009

What do you actually mean? Could you be a little bit more specific?

And don't triple post. :P


Re: Clan check? - stieben - 18.07.2009

ok, sorry for that.

I am building a stunt area with a gate in front. That stunt area should be for 1 certain clan (example: [GTA]). So the gate only opens if you're in that clan. I don't know how to make a code that checks if you're in that clan. Also I would like that clan to have their own color (example: green).

That is what I want