*** Terrible Title Removed
#1

I have a problem, when compiling, I got some errors. Here is the script:
Код:
CMD:money(playerid, params[])
{
	new playa,amount;
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "* Login please!");
	if(!sscanf(params, "ui", playa, amount))
	{
		if(IsPlayerConnected(playa) && playa != INVALID_PLAYER_ID)
		{
			if(gPlayerLogged[playa] == 0) return SendClientMessage(playerid, COLOR_RED, "* Target ID hasn't login! This can make an error.");
			if(PlayerInfo[playerid][pAdmin] < 6 || IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "* Only RCON admin, level 6, 1337, 1338 admin are allowed!");
			ResetPlayerMoney(playa);
			GivePlayerMoney(playa,amount);
			PlayerInfo[playa][pCash] = amount;
			new sendername;
			new targetname;
			new howlong;
			GetPlayerName(playerid, sendername);
			howlong = GetPlayerName(playa, targetname);
			new lastcharacter;
			strmid(lastcharacter, targetname, howlong-1, howlong);
			if(amount >= 0)
			{
			    new string[128];
			    format(string, sizeof(string), "* Admin %s has set your money to %d", sendername, amount);
			    SendClientMessage(playa,COLOR_LIGHTBLUE,string);
			    if(strcmp("a",lastcharacter,true)==0)
			    {
			    	format(string, sizeof(string), "* You set %s' money to %d", sendername, amount);
				}
				else
				{
				    format(string, sizeof(string), "* You set %s's money to %d", sendername, amount);
				}
				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			}
			else
			{
  				new string[128];
			    format(string, sizeof(string), "* Admin %s has set your money to %d", sendername, amount);
			    SendClientMessage(playa,COLOR_RED,string);
			    if(strcmp("a",lastcharacter,true)==0)
			    {
			    	format(string, sizeof(string), "* You set %s' money to %d", sendername, amount);
				}
				else
				{
				    format(string, sizeof(string), "* You set %s's money to %d", sendername, amount);
				}
				SendClientMessage(playerid, COLOR_RED, string);
			}
			return 1;
		}
		return 1;
	}
	else
	{
	    SendClientMessage(playerid, COLOR_RED, "* USAGE: /money [targetid] [amount]");
		return 1;
	}
}
Код:
C:\Users\123\Desktop\Pawn\project\gamemodes\script.pwn(4102) : error 035: argument type mismatch (argument 2)
C:\Users\123\Desktop\Pawn\project\gamemodes\script.pwn(4103) : error 035: argument type mismatch (argument 2)
C:\Users\123\Desktop\Pawn\project\gamemodes\script.pwn(4105) : error 035: argument type mismatch (argument 1)
C:\Users\123\Desktop\Pawn\project\gamemodes\script.pwn(4111) : error 035: argument type mismatch (argument 2)
C:\Users\123\Desktop\Pawn\project\gamemodes\script.pwn(4115) : error 029: invalid expression, assumed zero
C:\Users\123\Desktop\Pawn\project\gamemodes\script.pwn(4126) : error 035: argument type mismatch (argument 2)
C:\Users\123\Desktop\Pawn\project\gamemodes\script.pwn(4130) : error 029: invalid expression, assumed zero
Note: The "new howlong;" is on line 4101.

Edit: Solved! Now I know my mistake!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)