#1

I'm trying to make it so when a player logs in, if they have a warning on them it sends a message to all admins online saying something like "[WARN] Player XX has a live warning issued by another admin. I haven't been able to figure out how to send it to all admins using aBroadcast or any other way. Here is the check I use to see if the player is warned.

Quote:

if(PlayerInfo[playerid][pWarn] = 1)
{

Reply
#2

Haha, small typos mean A LOT!

You are assigning the value of one to the PlayerInfo array. I think you are intending to check the value of the player array. The operator you used is "=", the operator you want is "==".

Quote:

if(PlayerInfo[playerid][pWarn] == 1)
{

Reply
#3

Код:
if(PlayerInfo[playerid][pWarns] >= 1)
{
	format(string, sizeof(string), "[Warning] Player %s has %d Warnings!", targetid, PlayerInfo[playerid][pWarns]);
	SendAdminMessage(0xFF0000FF, string);
}
Something like this. If you need more help, PM me.
Reply
#4

oh yeah right, i forgot it
Reply
#5

Quote:
Originally Posted by DjSterios
Код:
if(PlayerInfo[playerid][pWarns] >= 1)
{
	format(string, sizeof(string), "[Warning] Player %s has %d Warnings!", targetid, PlayerInfo[playerid][pWarns]);
	SendAdminMessage(0xFF0000FF, string);
}
Something like this. If you need more help, PM me.
With that I get

C:\Users\staples036\Downloads\RLRP V2\gamemodes\rlrp.pwn(12161) : error 017: undefined symbol "string"
C:\Users\staples036\Downloads\RLRP V2\gamemodes\rlrp.pwn(12161) : error 017: undefined symbol "string"
C:\Users\staples036\Downloads\RLRP V2\gamemodes\rlrp.pwn(12161) : error 029: invalid expression, assumed zero
C:\Users\staples036\Downloads\RLRP V2\gamemodes\rlrp.pwn(12161) : fatal error 107: too many error messages on one line
Reply
#6

Because you haven't defined an array to hold the string...

Add this line inside the if clause:

Код:
new string[60];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)