Warning - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Warning (
/showthread.php?tid=74633)
Warning -
Mr_Assassin - 24.04.2009
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
Re: Warning -
Masj - 24.04.2009
Код:
#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?
Re: Warning -
Mr_Assassin - 24.04.2009
Sorry Wrong code my mistake.
Re: Warning -
Mr_Assassin - 24.04.2009
Ok Problem fixed, your post help me find the problem, Thanks again, The problem was with (new)