- 0
problema /pay
-
Similar Content
-
- 0 answers
- 81 views
-
- 6 replies
- 387 views
-
- 4 replies
- 338 views
-
- 1 answer
- 769 views
-
- 3 replies
- 260 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
Otiy
Salut am si eu o problema. Atunci cand dau pay arata la toti asa "You have recieved %d$ from %s(ID: %d)." codul este:
[pawn] if(strcmp(cmd, "/pay", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "You must have level 3 to send money over 1.000");
return 1;
}
if(moneys < 1 || moneys > 50000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 50.000 at once.");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");
return 1;
}
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " You can not pay for yourself !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerCash(playerid);
if (moneys > 0 && playermoney >= moneys)
{
//ConsumingMoney[giveplayerid] = 1;
if(paytime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "You can /pay once at 30 seconds.!");
GivePlayerCash(playerid, (0 - moneys));
GivePlayerCash(giveplayerid, moneys);
format(string, sizeof(string), "* You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "You have recieved %d$ from %s(ID: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
/*format(string, sizeof(string), "%s has paid $%d to %s", sendername, moneys, giveplayer);*/
PayLog(string);
paytime[playerid] = 1;
SetTimerEx("pay", 1, 0, "%d", playerid);
if(moneys >= 1)
{
ABroadCast(COLOR_LIGHTRED,string,1);
}
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Your too far away.");
}
}//invalid id
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}[/pawn]
1 answer to this question
Recommended Posts