Admin Title Issues
#1

Ok, so i'm trying to make an admin titles thing. I ran across an issue, well lets just let this do the talking

Код:
C:\Users\Jay\Desktop\FRP\gamemodes\ECRP.pwn(4642) : error 006: must be assigned to an array
C:\Users\Jay\Desktop\FRP\gamemodes\ECRP.pwn(40447) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
CMD:admintitle(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1338)
	{
		new giveplayerid, tmp[MAX_PLAYER_NAME];
		if(!sscanf(params, "us[20]", giveplayerid, tmp))
		{
		    if(IsPlayerConnected(giveplayerid))
		    {
		        new string[200];
		        MySQLCheckConnection();
				new giveplayer[MAX_PLAYER_NAME];
				giveplayer = PlayerInfo[giveplayerid][pAdminTitle];
				new sendername[MAX_PLAYER_NAME];
				sendername = PlayerName(playerid);
				new escstr[MAX_PLAYER_NAME];
				mysql_real_escape_string(tmp, escstr);
				//Update the stats time!
				format(string, sizeof(string),"UPDATE `userinf` SET `AdminTitle`='%s' WHERE `id`=%d ;", escstr, PlayerInfo[giveplayerid][pSQLID]);
				format(string, sizeof(string), "System: %s has changed your AdminTitle to %s.", sendername, tmp);
				SendClientMessage(giveplayerid, COLOR_ORANGE, string);
				format(string, sizeof(string),"System: %s has changed %s's Admin Title to %s.", sendername, giveplayer, tmp);
				ABroadCast(COLOR_YELLOW, string,1);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_LIGHTRED, "   Invalid player!");
			    return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /AdminTitle [playerid/PartOfName] [Title]");
		    SendClientMessage(playerid, COLOR_BRIGHTRED, "WARNING, Case sensitive");
		}
	}
	return 1;
}
Reply
#2

You can't assign strings like that.

pawn Код:
giveplayer = PlayerInfo[giveplayerid][pAdminTitle];
should be

pawn Код:
strcat(giveplayer, PlayerInfo[giveplayerid][pAdminTitle]);
and

pawn Код:
sendername = PlayerName(playerid);
should be

pawn Код:
strcat(sendername, PlayerName(playerid));
Reply
#3

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
You can't assign strings like that.

pawn Код:
giveplayer = PlayerInfo[giveplayerid][pAdminTitle];
should be

pawn Код:
strcat(giveplayer, PlayerInfo[giveplayerid][pAdminTitle]);
and

pawn Код:
sendername = PlayerName(playerid);
should be

pawn Код:
strcat(sendername, PlayerName(playerid));
Where in that script does it go exactly?
Reply
#4

You're supposed to replace the code I told you to replace.
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
You're supposed to replace the code I told you to replace.
One more error i had
Код:
	PlayerInfo[playerid][pAdminTitle] = "%s";
Код:
C:\Users\Jay\Desktop\FRP\gamemodes\ECRP.pwn(4643) : error 006: must be assigned to an array
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Get your own god damn script! Don't use my fucking script... God damn't. He is using my script, which I gaving no-one rights to use... btw, Anthony Heins here.
Reply
#7

Quote:
Originally Posted by dubyabeast
Посмотреть сообщение
Get your own god damn script! Don't use my fucking script... God damn't. He is using my script, which I gaving no-one rights to use... btw, Anthony Heins here.
then how would he have possibly gotten your script?
Reply
#8

I have no clue. But I did not give him my script, he may have leaked it from a volt-host file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)