Errors; I really don't understand why. -
FuilteachUrma - 29.12.2013
Код:
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
Re: Errors; I really don't understand why. -
EiresJason - 29.12.2013
pawn Код:
new CardNo[, Amount; //remove the "[" after CardNo.
Repost any errors when you fix that.
Re: Errors; I really don't understand why. -
FuilteachUrma - 29.12.2013
Код:
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(36074) : error 010: invalid function or declaration
Re: Errors; I really don't understand why. -
SilentSoul - 29.12.2013
Show us lines '36060 & 36074' or mark them on your script.
Re: Errors; I really don't understand why. -
FuilteachUrma - 29.12.2013
Line 36060 - format(str3, sizeof(str3), "Player %s[%s] has paid %s[%s] a sum of $%s.", GetName(playerid), GetPlayerIp(playerid), GetName(i), GetPlayerIp(i), Amount);
Line 36074 - return 1;
Re: Errors; I really don't understand why. -
FuilteachUrma - 29.12.2013
Fixed the error; still 4 warnings
AW: Errors; I really don't understand why. -
CutX - 29.12.2013
the format is correct but check these
GetName(playerid),
GetPlayerIp(playerid),
GetName(i),
GetPlayerIp(i)
functions. you're missing parameters in some or one of them,
as compiler said:
number of arguments does not match definition
Re: Errors; I really don't understand why. -
FuilteachUrma - 29.12.2013
Thanks guys! +rep each.
Fixed it simply by;
new str1[256], str2[256], str3[256];
new PayerIP[16], RecieverIP[16], Name1[124], Name2[124];
GetPlayerIp(playerid, PayerIP, sizeof(PayerIP));
GetPlayerIp(i, RecieverIP, sizeof(RecieverIP));
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(i, Name2, sizeof(Name2));
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.", Name1, PayerIP, Name2, RecieverIP, Amount);
SendToAdmins(ADMINORANGE, str3, 0);