invalid expression, assumed zero
#1

Im tryng to make contract cmd but it says

Код:
C:\Users\Eigenaar\Desktop\Windows-Server\gamemodes\vx-rp.pwn(17331) : error 029: invalid expression, assumed zero
at line

Код:
else
here :

Код:
playerVariables[ID][pHitamount] = amount;
					playerVariables[ID][pHit] = 1;

				}
				else
				{
Код:
CMD:contract(playerid, params[]) {

	new amount;
	if(sscanf(params, "dd", ID, amount))
	{
		SendClientMessage(playerid, COLOR_RED, "USAGE: /hit [ID] [amount]");
	}
	else if(amount > 0)
	{
		if(IsPlayerConnected(ID))
		{
			if(GetPlayerMoney(playerid) >= amount)
			{
					Hit[ID] = amount;
					hiter[ID] = playerid;
					new string[256];
					format(string, sizeof(string), "You have placed a hit on %s (%i) for $%i", ReturnPlayerName(ID), ID, amount);
					SendClientMessage(playerid, COLOR_RED, string);
					format(string, sizeof(string), "%s (%i) has placed a hit on %s (%i) for $%i", ReturnPlayerName(playerid), playerid, ReturnPlayerName(ID), ID, amount);
					SendClientMessageToAll(COLOR_RED, string);
					playerVariables[ID][pHitamount] = amount;
					playerVariables[ID][pHit] = 1;

				}
				else
				{
					SendClientMessage(playerid, COLOR_RED, "Please wait before placing another hit!");
				}
   }
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have enough money!");
			}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "That player is not connected!");
  }
 }
	else
	{
		SendClientMessage(playerid, COLOR_RED, "Minimum amount to hit a person with is $1!");
 }
	return 1;
}
Reply
#2

Try this:
pawn Код:
CMD:contract(playerid, params[])
{
    new amount, ID;
    if(sscanf(params, "ud", ID, amount)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /hit [ID] [amount]");
    if(amount < 1) return SendClientMessage(playerid, COLOR_RED, "Minimum amount to hit a person with is $1!");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "That player is not connected!");
    if(GetPlayerMoney(playerid) < amount) return SendClientMessage(playerid, COLOR_RED, "You do not have enough money!");{

    Hit[ID] = amount;
    hiter[ID] = playerid;
    new string[256];
    format(string, sizeof(string), "You have placed a hit on %s (%d) for $%i", ReturnPlayerName(ID), ID, amount);
    SendClientMessage(playerid, COLOR_RED, string);
    format(string, sizeof(string), "%s (%d) has placed a hit on %s (%d) for $%i", ReturnPlayerName(playerid), playerid, ReturnPlayerName(ID), ID, amount);
    SendClientMessageToAll(COLOR_RED, string);
    playerVariables[ID][pHitamount] = amount;
    playerVariables[ID][pHit] = 1;
    return 1;
}
Reply
#3

ty bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)