Need help in { /r }
#1

Hello guys , Im facing allot of problems from this command { /r }

SCRIPT::

Код:
CMD:r(playerid, params[])
{
	new string[128];
	if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/r)adio [radio chat]");

	new rank[64];
	switch (PlayerInfo[playerid][pMember])
	{
	case 1:
		{
			switch(PlayerInfo[playerid][pMember])
			{
			case 1: rank = "Sergeant";
			case 2: rank = "Risker";
			case 3: rank = "Captain";
			case 4: rank = "Lieutenant";
			case 5: rank = "Under-Leader";
			case 6: rank = "Leader";
			default: rank = "Trainer";
			}
			format(string, sizeof(string), " %s %s: %s ,over ^", rank, GetPlayerName(playerid), params);
			SendRadioMessage(1, RADIO, string);
			}
	default:
		{
			SendClientMessage(playerid,COLOR_GRAD2,"You're not in a faction.");
			return 1;
		}
	}
	format(string, sizeof(string), "(radio) %s",params);
	SetPlayerChatBubble(playerid,string,COLOR_WHITE,15.0,5000);
	return 1;
}
My Errors::

Код:
C:\Users\BCC\Desktop\ZMRP\gamemodes\ZM-RP.pwn(139) : warning 202: number of arguments does not match definition
C:\Users\BCC\Desktop\ZMRP\gamemodes\ZM-RP.pwn(139) : warning 202: number of arguments does not match definition
C:\Users\BCC\Desktop\ZMRP\gamemodes\ZM-RP.pwn(140) : error 004: function "SendRadioMessage" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
If you know the reason please tell me thanks!!
Reply
#2

"SendRadioMessage" is no stock

Try adding
pawn Код:
stock SendToGroup(groupid, colour, string[]) {
    if(groupid > 0) {
        foreach(Player, i) {
            if(playerVariables[i][pStatus] == 1 && playerVariables[i][pGroup] == groupid) {
                SendClientMessage(i, colour, string);
            }
        }
    }
    return 1;
}
Edit it to fit your script then replace SendRadioMessage with SendToGroup

How is it suppose to "switch (PlayerInfo[playerid][pMember])" when you haven't even added that IF in the CMD?
Reply
#3

Quote:
Originally Posted by Daniel_Davis
Посмотреть сообщение
"SendRadioMessage" is no stock

Try adding
pawn Код:
stock SendToGroup(groupid, colour, string[]) {
    if(groupid > 0) {
        foreach(Player, i) {
            if(playerVariables[i][pStatus] == 1 && playerVariables[i][pGroup] == groupid) {
                SendClientMessage(i, colour, string);
            }
        }
    }
    return 1;
}
Edit it to fit your script then replace SendRadioMessage with SendToGroup

How is it suppose to "switch (PlayerInfo[playerid][pMember])" when you haven't even added that IF in the CMD?
You can add a switch statements without having to add an if statement.

On Topic.
On the line
pawn Код:
format(string, sizeof(string), " %s %s: %s ,over ^", rank, GetPlayerName(playerid), params);
That is a SA-MP native function which looks like this:
pawn Код:
GetPlayerName(playerid, const name[], len))
You did not fill it out correctly instead of using GetPlayerName(playerid), make a stock like this.
pawn Код:
stock GetName(playerid)
{
    new name[24];
    GetPlayerName(playerid,name,sizeof(name));
    return name;
}
What this stock does is it gets a player's name and returns the name as a string,
Now on the line
pawn Код:
format(string, sizeof(string), " %s %s: %s ,over ^", rank, GetPlayerName(playerid), params);
Replace GetPlayerName(playerid) with
Код:
GetName(playerid)
since it matches our stock made above.
Now that should fix two errors, to fix the last one. Post your SendRadioMessage function.
Reply
#4

WEll Thanks guys
Reply
#5

sorry for this but I still have 1 error

Код:
C:\Users\BCC\Desktop\ZMRP\gamemodes\ZM-RP.pwn(230) : error 004: function "SendRadioMessage" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Quote:
Originally Posted by Daniel_Davis
Посмотреть сообщение
"SendRadioMessage" is no stock

Try adding
pawn Код:
stock SendToGroup(groupid, colour, string[]) {
    if(groupid > 0) {
        foreach(Player, i) {
            if(playerVariables[i][pStatus] == 1 && playerVariables[i][pGroup] == groupid) {
                SendClientMessage(i, colour, string);
            }
        }
    }
    return 1;
}
Edit it to fit your script then replace SendRadioMessage with SendToGroup

How is it suppose to "switch (PlayerInfo[playerid][pMember])" when you haven't even added that IF in the CMD?
By the way you forgot to add some {news} and {enum} in player info.. thats why Im receiving errors!
and LOL you have copied it from a script!! and edited it lol that proof that if you made it you you would defined and included and make enums and new{s} !!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)