CMD:penzad(playerid, params[])
{
if(pInfo[playerid][pALogin] == 0) return SendClientMessage(playerid, PIROS, \"{66FFFF}A szerveren nincs {FF0000}/pénzad {66FFFF}parancs!\");
if(pInfo[playerid][pAdmin] >= 3)
{
new S1[128], S2[128], Osszeg;
if(sscanf(params, \"ud\", id, Osszeg)) return SendClientMessage(playerid, PIROS, \"Használat: /pénzad < Név / Id > < Összeg >\");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, PIROS, \"A játékos nem elérhetõ!\");
format(S1, sizeof(S1), \"%s adott neked $%d -t \", pInfo[playerid][pANev], Osszeg);
SendClientMessage(id, FONTOS, S1);
format(S2, sizeof(S2), \"%s adott %s számára $%d -t \", pInfo[playerid][pANev], Nev(id), Osszeg);
SendOwnerMessage(FONTOS, S2);
pInfo[id][pMoney] += Osszeg;
}
else
{
SendClientMessage(playerid, PIROS, \"Nem szabad!\");
}
}
else
{
SendClientMessage(playerid, PIROS, \"{66FFFF}A szerveren nincs {FF0000}/pénzad {66FFFF}parancs!\");
}
return 1;
}
Dupla hozzászólás automatikusan összefûzve. ( 2013. augusztus 28. - 12:55:24 )
És itt van a textdrawos része.
forward CheckMoney(playerid);
public CheckMoney(playerid)
{
new string[128], asd[128], asd2[128], asd3[128];
if(pInfo[playerid][pMoney] < 10)
{
format(string, sizeof(string), \"$0000000%i\", pInfo[playerid][pMoney]);
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(10 <= pInfo[playerid][pMoney] < 100)
{
format(string, sizeof(string), \"$000000%i\", pInfo[playerid][pMoney]);
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(100 <= pInfo[playerid][pMoney] < 1000)
{
format(string, sizeof(string), \"$00000%i\", pInfo[playerid][pMoney]);
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(1000 <= pInfo[playerid][pMoney] < 10000)
{
format(string, sizeof(string), \"$0000%i\", pInfo[playerid][pMoney]);
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(10000 <= pInfo[playerid][pMoney] < 100000)
{
format(string, sizeof(string), \"$000%i\", pInfo[playerid][pMoney]);
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(100000 <= pInfo[playerid][pMoney] < 1000000)
{
format(string, sizeof(string), \"$00%i\", pInfo[playerid][pMoney]);
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(1000000 <= pInfo[playerid][pMoney] < 10000000)
{
format(string, sizeof(string), \"$0%i\", pInfo[playerid][pMoney]);
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(10000000 <= pInfo[playerid][pMoney] < 999999999)
{
format(string, sizeof(string), \"$%i\", pInfo[playerid][pMoney]);
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}