radio system
#1

This is my epic fail of a radio system any idea on how to make this work.

Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp("/r", cmdtext, true, 10) == 0) {
  {
   if (classid == 106 || classid == 105 || classid == 107) {
   SendPlayerMessageToPlayer(classid == 106 || classid == 105 || classid == 107);
	}
	
    return 1;
  }
  return 0;
}
Reply
#2

u didn't add something so the poeple can send a message, actually, this command is no-use. look in PM fs or anything with SendClientMessageToAll, etc
Reply
#3

sry for not posting in the "code"..firstly

below the #includes:

forward radiomessage();
new pclass[MAX_PLAYERS]
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//----------------------------
at:
public OnPlayerRequestClass(playerid, classid)
{
pclass[playerid] = classid;
return1;
}
//----------------------------
Anywhere:

public radiomessage()
{
for(new i=0; i < GetMaxPlayers; i++)
if(IsPlayerConnected(i)){
if(pclass[playerid] == 106 || pclass[playerid}] == 105 || pclass[playerid}] == 107){
SendClientMessage(i, color, string);
}
}
return 1;
}
//----------------------------
Anywhere:
dcmd_r(playerid, params[])
{
new pname[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s in Radio: %s", pname, params);
radiomessage(COLORYOUWANT, string);
return 1;
}
//----------------------------

At:
OnPlayerCommandText(playerid, cmdtext);
{
dcmd(r, 1, cmtext);
return 1;
}




Try that...
Reply
#4

i just want a simple code that send message to only certian skins thats all
Reply
#5

Ok ive change it to this but get these errors.

Code:
C:\Users\alex\Desktop\Streets of los santos\gamemode\SW-LS.pwn(179) : error 017: undefined symbol "classid"
C:\Users\alex\Desktop\Streets of los santos\gamemode\SW-LS.pwn(179) : error 036: empty statement
C:\Users\alex\Desktop\Streets of los santos\gamemode\SW-LS.pwn(181) : error 010: invalid function or declaration
C:\Users\alex\Desktop\Streets of los santos\gamemode\SW-LS.pwn(183) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (classid == 106 || classid == 105 || classid == 107);
      }
      if (classid[playerid] == classid == 106 || classid == 105 || classid == 107) {
      SendClientMessage(playerid,TEAM_GROVE_COLOR)
			return 1;
		}
Reply
#6

Did you get it working?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)