C:\Documents and Settings\Vicki\Desktop\josh\SCRIPTING\TDM\gamemodes\LSGW.pwn(336) : error 028: invalid subscript (not an array or too many subscripts): "pMuted"
C:\Documents and Settings\Vicki\Desktop\josh\SCRIPTING\TDM\gamemodes\LSGW.pwn(336) : warning 215: expression has no effect
C:\Documents and Settings\Vicki\Desktop\josh\SCRIPTING\TDM\gamemodes\LSGW.pwn(336) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Vicki\Desktop\josh\SCRIPTING\TDM\gamemodes\LSGW.pwn(336) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Vicki\Desktop\josh\SCRIPTING\TDM\gamemodes\LSGW.pwn(336) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
enum PlayerInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pTeam,
Banned,
TimesBanned,
pMuted,
}
new PlayerStat[MAX_PLAYERS][PlayerInfo];
forward unmuteTimer(playerid);
public unmuteTimer(playerid)
{
pMuted[playerid] = 0; return SendClientMessage(playerid, -1, "You are no longer muted!"); //this is where the error occurs... It's happening for every stat I try to create for the player, whether it's [TimesBanned] or anything.. same problem
CMD:mute(playerid, params[])
{
new id, reason[80], minutes, string[128];
if(IsPlayerAdmin(playerid < 1 ))
if(sscanf(params, "uis[80]", id, minutes, reason)) SendClientMessage(playerid,0xFFFF0000,"Usage: /mute [playerid/name] [time] [reason]");
if(id == playerid) SendClientMessage(playerid,RED,"You cannot use this command on yourself!");
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) SendClientMessage(playerid,RED,"Player not found!");
if(time == 0) //perm mute
{
format(string, sizeof(string), "~ %s has been muted. Reason: '%s' ", GetICName(id), minutes, reason);
pMuted[id] = 1; //if I delete the timer, I get the same error
}
else
{
format(string, sizeof(string), "~ %s has been muted for %i minutes. Reason: '%s' ", GetICName(id), minutes, reason);
pMuted[id] = 1; //if I get rid of "pMuted" above, I get the error here instead
SetTimerEx("unmuteTimer", 60*1000*minutes, false, "i", id);
}
SendClientMessageToAll(YELLOW, string);
print(string);
return 1;
}
forward unmuteTimer(playerid);
public unmuteTimer(playerid)
{
PlayerStat[playerid][pMuted] = 0; return SendClientMessage(playerid, -1, "You are no longer muted!");
You are using it wrong sir.
Its PlayerStat[playerid][pMuted], not pMuted[playerid]. PHP код:
This tutorial taught me better use of Enumerators, this will help you too. https://sampforum.blast.hk/showthread.php?tid=318307 |
if(id == playerid) return SendClientMessage(playerid, RED,"You cannot use this command on yourself!");
if(id == INVALID_PLAYER_ID) SendClientMessage(playerid,RED,"Player not found!");
C:\Documents and Settings\Vicki\Desktop\josh\SCRIPTING\TDM\gamemodes\LSGW.pwn(382) : error 035: argument type mismatch (argument 2) C:\Documents and Settings\Vicki\Desktop\josh\SCRIPTING\TDM\gamemodes\LSGW.pwn(383) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
#define RED
#define RED "0xFF0000"//Or w/e :P
#define RED 0xFF0000//Simila