Need help fast. +1 rep -
Jesper00 - 24.02.2014
Hey i got this error and then some more.,
Код:
C:\Users\Canip\Desktop\LSRPG\gamemodes\RPG.pwn(474) : warning 201: redefinition of constant/macro (symbol "COLOR_RED")
C:\Users\Canip\Desktop\LSRPG\gamemodes\RPG.pwn(475) : warning 201: redefinition of constant/macro (symbol "COLOR_GREEN")
C:\Users\Canip\Desktop\LSRPG\gamemodes\RPG.pwn(1032) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Users\Canip\Desktop\LSRPG\gamemodes\RPG.pwn(1032) : warning 215: expression has no effect
C:\Users\Canip\Desktop\LSRPG\gamemodes\RPG.pwn(1032) : error 001: expected token: ";", but found "]"
C:\Users\Canip\Desktop\LSRPG\gamemodes\RPG.pwn(1032) : error 029: invalid expression, assumed zero
C:\Users\Canip\Desktop\LSRPG\gamemodes\RPG.pwn(1032) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Here is a part of this script
pawn Код:
enum PlayerInfo
{
Logged,
miniadmin,
Level,
Duty,
hDuty,
Cash,
pGD,
pTS,
pVip,
pCop,
pAmmo,
pGuns,
Banned,
pDriver,
pPilot,
pGunlicense,
pFaction,
pRank,
Binco,
Cocaine,
Weed,
Pills,
Crack,
TutDone,
pNumber,
pAFK,
pMuted,
DMVTrainer,
Jailed,
JailTimer,
}
new PInfo[MAX_PLAYERS][PlayerInfo];
new id;
new Text:jail_timeleft[MAX_PLAYERS];
//Areest
CMD:arrest(playerid,params[]) {
if(GetPlayerSkin(playerid) != 280 && GetPlayerSkin(playerid) != 290 && GetPlayerSkin(playerid) != 288 && GetPlayerSkin(playerid) != 281 && GetPlayerSkin(playerid) != 282 && GetPlayerSkin(playerid) != 283 && GetPlayerSkin(playerid) != 284 && GetPlayerSkin(playerid) != 285 && GetPlayerSkin(playerid) != 286 && GetPlayerSkin(playerid) != 287 && GetPlayerSkin(playerid) != 288 && GetPlayerSkin(playerid) != 289) return 0;
new time,reason[100],str1[256];
new str[256];
if(sscanf(params,"dds",id,time,reason)) return SendClientMessage(playerid, COLOR_BLUE, "-- Server: {USAGE} /arrest <playerid> <time> <reason>");
if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_BLUE, "-- Server: {ERROR} Player is not connected.");
if(PlayerInfo[id][Jailed] == 1)return SendClientMessage(playerid,COLOR_BLUE,"-- Server: {ERROR} Player is already arrested.");
format(str, sizeof(str), "Officer %s has arrested %s for %d minutes; RP Reason: %s", PlayerName(id), id, time, reason);
SendClientMessageToAll(COLOR_RED,str);
PlayerInfo[id][Jailed] = 1;
SetPlayerInterior(id, 6);
SetPlayerVirtualWorld(id, 0);
SetPlayerFacingAngle(id, 360.0);
SetPlayerPos(id,264.3290,82.2896,1001.0391);
SetPlayerHealth(id, 100.0);
ResetPlayerWeapons(id);
PlayerInfo[id][JailTimer] = SetTimerEx("Unjail",time*60000, false, "i", id);
return 1;
}
forward Unjail(playerid);
public Unjail(playerid) {
new ReturnName[MAX_PLAYER_NAME],strr2[256];
GetPlayerName(playerid, ReturnName, sizeof(ReturnName));
SendClientMessage(playerid, COLOR_RED,"You have payed your bail for your work. 450$");
PlayerInfo[playerid][Jailed] = 0;
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(id,1545.7330,-1675.2095,13.5609);
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -450);
KillTimer(PlayerInfo[playerid][JailTimer]);
return 1;
}
pawn Код:
Line 1032: if(PlayerInfo[id][Jailed] == 1)return SendClientMessage(playerid,COLOR_BLUE,"-- Server: {ERROR} Player is already arrested.");
Re: Need help fast. +1 rep -
KaliKs - 24.02.2014
what i found first was that you should remove behind
Код:
JailTimer, //remove ","
and for line 1032 show the exact line please
Re: Need help fast. +1 rep -
Jesper00 - 24.02.2014
It does the same thing. But have sent line 1032
Re: Need help fast. +1 rep -
Konstantinos - 24.02.2014
PlayerInfo is the name of the enum and PInfo is the name of the array. You've used the opposite in your code so either swap those two or change PlayerInfo to PInfo. Few of them:
pawn Код:
PlayerInfo[id][Jailed]
PlayerInfo[id][JailTimer]
PlayerInfo[playerid][Jailed] = 0;
and it should be:
pawn Код:
PInfo[id][Jailed]
PInfo[id][JailTimer]
PInfo[playerid][Jailed] = 0;
Re: Need help fast. +1 rep -
KaliKs - 24.02.2014
but if you tried to make it as
Код:
Logged,
pminiadmin,
Level,
Duty,
hDuty,
Cash,
pGD,
pTS,
pVip,
pCop,
pAmmo,
pGuns,
Banned,
pDriver,
pPilot,
pGunlicense,
pFaction,
pRank,
pBinco,
pCocaine,
pWeed,
pPills,
pCrack,
pTutDone,
pNumber,
pAFK,
pMuted,
pDMVTrainer,
pJailed,
pJailTimer,
}