Warning
#1

This is my first post, and yes I'm no expert at scripting, you could say that i'm a beginner.
So if someone can please help me, Thanks.

I get a "E:\GameTest.pwn(311) : warning 217: loose indentation"

Код:
#include <a_samp>
#include <cps>
#include <Dudb>
#include <dutils>
#pragma unused ret_mem


//----------------------------------------------------------------------------------------------------------------------------
public OnPlayerDeath(playerid, killerid, reason)
{
  if(killerid == INVALID_PLAYER_ID)
	{
	SendDeathMessage(killerid, playerid, reason);
  SendClientMessage(playerid, light_blue, "You died and lost your money!");
  ResetPlayerMoney(playerid); 
  }
	else if (!(killerid == INVALID_PLAYER_ID))
	{

new pname[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new string[128];
new money;
  money = GetPlayerMoney(playerid); //E:\GameTest.pwn(311) : warning 217: loose indentation
  GetPlayerName(killerid,pname,sizeof(pname));
  GetPlayerName(playerid,playername,sizeof(playername));
  format(string, sizeof(string), " %s killed %s and has taken $%d from him.",pname,playername,money);
  SendDeathMessage(killerid, playerid, reason);
  SendClientMessage(playerid, light_blue, string);
  GivePlayerMoney(killerid,money);
  ResetPlayerMoney(playerid);
	}
  return 1;
  
}

}
Got one more Problem After this one
Reply
#2

Код:
#include <a_samp>
#include <cps>
#include <Dudb>
#include <dutils>
#pragma unused ret_memcpy

public OnPlayerCommandText( playerid, cmdtext[] )
{
							 //GIVECASH///
	new
		cmd1[256],
		idx1;
	cmd1 = strtok(cmdtext, idx1);
	if ( strcmp( "/givecash", cmd1, true ) == 0 || strcmp( "/givemoney", cmd1, true ) == 0 || strcmp(" /pay", cmd1, true ) == 0 )
	{
    new
			tmp[256],
			tmp2[256],
			cmdid,
			ammount;
    tmp = strtok(cmdtext, idx1);
    tmp2 = strtok(cmdtext, idx1);

    if ( !strval( tmp ) || !strval( tmp2 ) ) return SendClientMessage( playerid, light_green, "Usage: /GiveCash [playerid] [ammount]" );

    cmdid = strval(tmp);
    ammount = strval(tmp2);

    if ( IsPlayerConnected( cmdid ) == 0 ) return SendClientMessage( playerid, light_green, "That player is not connected" );
    if ( GetPlayerMoney( playerid ) < ammount ) return SendClientMessage( playerid, light_green, "You don't have enough money" );

    new
			pname[ MAX_PLAYER_NAME ],
			oname[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, pname, MAX_PLAYER_NAME );
    GetPlayerName( cmdid, oname, MAX_PLAYER_NAME );

    GivePlayerMoney( playerid, -ammount );
    GivePlayerMoney( cmdid, ammount );

    new
			string[256];
    format( string, 256, "You have given \"%s\" $%d", oname, ammount );
    SendClientMessage( playerid, light_green, string );
    format( string, 256, "You have received $%d from \"%s\"", ammount, pname );
    SendClientMessage( cmdid, light_green, string );
    return 1;
	}
	return 0;
}
now good?
Reply
#3

Sorry Wrong code my mistake.
Reply
#4

Ok Problem fixed, your post help me find the problem, Thanks again, The problem was with (new)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)