SA-MP Forums Archive
/changecrank help - 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)
+--- Thread: /changecrank help (/showthread.php?tid=299237)



/changecrank help - Jordiee - 24.11.2011

This is my /g(roup) command:
Код:
CMD:group(playerid, params[]) {

	if(playerVariables[playerid][pStatus] != 1 || playerVariables[playerid][pGroup] < 1) return 1;
	if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 0 || groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 2) {
	    return SendClientMessage(playerid, COLOR_GREY, "This group does not have an OOC chat.");
	}
	new
	    string[128];

	if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/g(roup) [message]");

	if(playerVariables[playerid][pFreezeType] > 0) {
		return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while cuffed, tazed, or frozen.");
	}

 	GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

	switch(playerVariables[playerid][pGroupRank]) {

		case 1:	format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName1], szPlayerName, params);
		case 2:	format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName2], szPlayerName, params);
		case 3:	format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName3], szPlayerName, params);
		case 4:	format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName4], szPlayerName, params);
		case 5:	format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName5], szPlayerName, params);
		case 6:	format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName6], szPlayerName, params);
		default: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName1], szPlayerName, params);
	}
    SendToGroup(playerVariables[playerid][pGroup], COLOR_DCHAT, string);
	return 1;
}
FINNALLY GOT IT WORKING

And I was wondering How to make it like this:
(Group Chat) [[[(Null)]]] Sheriff Carl_Summers: where it says Null, you can change that to whatever you want with a /changecrank command.. Is there anyway of doing it?


Re: /changecrank help - Alberto_DR - 25.11.2011

try using a variable to contain it but I guess its better to use a specific rank name on a rank.


Re: /changecrank help - Jordiee - 25.11.2011

I dunno nothing about Variable's as im new to scripting, can you help me out a little.


Re: /changecrank help - Jordiee - 25.11.2011

Can someone help me?


Re: /changecrank help - Mr_Scripter - 25.11.2011

is it fixed?


Re: /changecrank help - Jordiee - 25.11.2011

Nope.


Re: /changecrank help - Jordiee - 25.11.2011

anyone know how to do this?