sendcash command dont work

Started by UncleRus, Aug 18, 2020, 07:12 AM

Previous topic - Next topic

UncleRus

Why this command dont work i put functions but dont work else if ( cmd == "sendcash" )
{
local Pos = player.Pos, checkpoly;
checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
   if ( stats[ player.ID ].Reg == false ) return MessagePlayer( "[#95fcff]ENTRY > [#E0E0E0]You're not registered", player );
else if ( stats[ player.ID ].Log == false ) return MessagePlayer( "[#95fcff]ENTRY > [#E0E0E0]You're not Logged-In", player );
else if ( !player.IsSpawned ) MessagePlayer( "[#95fcff]ENTRY > [#E0E0E0]You must be spawn first.", player );
else if( checkpoly == false ) MessagePlayer( "[#95fcff]WARN > [#E0E0E0]You must be in Bank", player );
else if ( !text )
{
MessagePlayer("[#95fcff]INFO > [#E0E0E0]Code: /sendcash [amount] [NAME/ID]", player );
return;
}
else if ( NumTok( text, " " ) < 2 ) MessagePlayer("[#95fcff]INFO > [#E0E0E0]Code: /sendcash [amount] [NAME/ID]", player );
else {
local plr = GetPlayer( GetTok( text, " ", 2 ) );
if ( !plr ) MessagePlayer( "[#95fcff]WARN > [#E0E0E0]Unkown Player", player );
else if (plr.ID == player.ID) MessagePlayer("[#95fcff]WARN > [#E0E0E0]You can't send cash to youself",player);
else {
local Poss = plr.Pos, checkpolyy;
checkpoly = InPoly( Poss.x, Poss.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( checkpolyy == false ) {
    MessagePlayer("[#95fcff]INFO > [#E0E0E0]You must be in Bank", player );
    MessagePlayer("[#95fcff]INFO > [#E0E0E0]"+player.Name+"
Forensic player wants to give you money, you need to be at the bank to receive the money!",plr);
    }
else {
if ( text.tointeger() > player.Cash ) MessagePlayer( "[#95fcff]WARN > [#E0E0E0]Unkown Value", player );
else if (!IsNum(GetTok( text, " ", 1 ) ) ) MessagePlayer( "[#95fcff]WARN > [#E0E0E0]Value mast be in number", player );
else if ( text.tointeger() < 0 ) MessagePlayer( "", player );
else {
DecCash( player, text.tointeger() );
IncCash( plr, text.tointeger() );
MessagePlayer("[#95fcff]INFO > [#E0E0E0]The cos was given " + text.tointeger() + "$, to" + plr.Name + " .",player);
MessagePlayer("[#95fcff]INFO > [#E0E0E0]"+player.Name+" forensic player you, " + text.tointeger() + "$ sent",plr);
}
}
}
}
}
I LoperkinDead.My brothers scripters TimyrSem,VladSem

SHy^

Send error written in console along the line and use BB tags.

UncleRus

Thanks for answering, but I fixed the problem thanks
I LoperkinDead.My brothers scripters TimyrSem,VladSem

NicusorN5

Please use the code tag next time. PLEASE.
like that
900th post, wooo!