07.04.2012, 22:20
Try This:
I figured out your first problem and explained it in a comment. Don't forget to read the comments.
pawn Код:
COMMAND:pay(playerid, params[])
{
new TargetID, Cash, money; // you were missing the ";" there, making you get your first error.
if(sscanf(params, "ui", TargetID, Cash)) return SendClientMessage(playerid, GREY, "[Sintakse]: /showid [spe-le-ta-jaID].");
if(!IsPlayerConnected(TargetID)) return SendClientMessage(playerid, GREY, "That Player Is Not Connected");
if(TargetID == playerid) return SendClientMessage(playerid, GREY, "You Cannot Pay Yourself"); //This is supposed to be TargetID not playerid.
money = GetPlayerMoney(playerid);
if(Cash > money) return SendClientMessage(playerid, GREY, "You Do Not Have That Amount Of Money With You!"); // I added this line so players won't be able to give more money than they really have.
if(Cash > 0 && Cash < 10000)
{
if(GetDistanceBetweenPlayers(playerid, TargetID) < 5)
{
GivePlayerMoney(playerid, -Cash);
GivePlayerMoney(TargetID, Cash);
}
else
{
SendClientMessage(playerid, GREY, "[Kl,u-da]: Tu atrodies pa-ra-k ta-lu no spe-le-ta-ja.");
}
}
return 1;
}