Hello,today i was trying to use this command on my script and i get the errors :
Here is the command :
Script is from Godfather i believe.
Thank you
Code:
: error 028: invalid subscript (not an array or too many subscripts): "weapons"
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
Code:
CMD:listguns(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128], giveplayerid;
if(sscanf(params, "i", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /listguns [playerid]");
if(IsPlayerConnected(giveplayerid))
{
new weapons[13][2], weaponname[50];
if(GetPVarInt(giveplayerid, "EventToken") != 0 || GetPVarInt(giveplayerid, "IsInArena") >= 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "That player is at an event/paintball so the weapons may appear as non-server sided.");
}
SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
format(string, sizeof(string), "Weapons on %s:", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(giveplayerid, i, weapons[i][0], weapons[i][1]);
if(weapons[i][0] > 0)
{
if(PlayerInfo[giveplayerid][pGuns][i] == weapons[i][0])
{
GetWeaponName(weapons[i][0], weaponname, sizeof(weaponname));
format(string, sizeof(string), "Name: %s, Ammo: %d (ID %d).", weaponname, weapons[i][1], weapons[i][0]);
SendClientMessageEx(playerid, COLOR_GRAD1, string);
}
else
{
GetWeaponName(weapons[i][0], weaponname, sizeof(weaponname));
format(string, sizeof(string), "Name: %s, Ammo: %d (ID %d) (non server-side).", weaponname, weapons[i][1], weapons[i][0]);
SendClientMessageEx(playerid, COLOR_GRAD1, string);
}
}
}
SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
Thank you