SA-MP Forums Archive
radio system - 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: radio system (/showthread.php?tid=140669)



radio system - 02manchestera - 10.04.2010

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;
}



Re: radio system - pmk1 - 10.04.2010

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


Re: radio system - Sascha - 10.04.2010

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...


Re: radio system - 02manchestera - 10.04.2010

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


Re: radio system - 02manchestera - 10.04.2010

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;
		}



Re: radio system - Steven82 - 10.04.2010

Did you get it working?