29.12.2013, 16:22
Код:
command(ccpay, playerid, params[])
{
new CardNo[, Amount;
if(sscanf(params, "dd", CardNo, Amount))
{
SendClientMessage(playerid, WHITE, "SYNTAX: /ccpay [CardNo] [Amount]");
}
else
{
if(Amount < 1)
{
}
else
{
if(Player[playerid][PhoneN] >= 1)
{
if(Player[playerid][BankStatus] == 1)
{
SendClientMessage(playerid, RED, "The authorities have suspended your bank account.");
}
else
{
if(Player[playerid][BankMoney] >= Amount)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(Player[i][CreditCard] == CardNo)
{
new str1[256], str2[256], str3[256];
Player[playerid][BankMoney] -= Amount;
Player[i][BankMoney] += Amount;
format(str1, sizeof(str1), "You have paid Credit Card: %s for the amount of %s.", CardNo, Amount);
SendClientMessage(playerid, NICESKY, str1);
format(str2, sizeof(str2), "You have received %s from %s, this has been added to your bank account.", Amount, GetName(playerid));
SendClientMessage(i, NICESKY, str2);
format(str3, sizeof(str3), "Player %s[%s] has paid %s[%s] a sum of $%s.", GetName(playerid), GetPlayerIp(playerid), GetName(i), GetPlayerIp(i), Amount);
SendToAdmins(ADMINORANGE, str3, 0);
}
else
{
SendClientMessage(playerid, WHITE, "The credit card you are attempting to pay is currently unavailable((May be offline))");
}
}
}
}
}
}
}
}
return 1;
}
Код:
Vortex.pwn(36051) : error 033: array must be indexed (variable "CardNo") Vortex.pwn(36060) : warning 202: number of arguments does not match definition Vortex.pwn(36060) : warning 202: number of arguments does not match definition Vortex.pwn(36060) : warning 202: number of arguments does not match definition Vortex.pwn(36060) : warning 202: number of arguments does not match definition Vortex.pwn(36078) : error 010: invalid function or declaration

