SA-MP Forums Archive
Admin Title Issues - 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)
+--- Thread: Admin Title Issues (/showthread.php?tid=440448)



Admin Title Issues - Jay_Dixon - 29.05.2013

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



Re: Admin Title Issues - SuperViper - 29.05.2013

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



Re: Admin Title Issues - Jay_Dixon - 29.05.2013

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?


Re: Admin Title Issues - SuperViper - 30.05.2013

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


Re: Admin Title Issues - Jay_Dixon - 31.05.2013

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.



Re: Admin Title Issues - dubyabeast - 31.05.2013

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.


Re: Admin Title Issues - BossZk - 31.05.2013

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?


Re: Admin Title Issues - dubyabeast - 31.05.2013

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