02.09.2010, 13:50
Hi there. I am developind a new GM from scratch, and I have a little problem with enums (it`s true I haven`t scripting for a while )
Here`s the enum:
Here`s the command:
And here are the errors :
Some help maybe?
Here`s the enum:
Код:
enum pInfo { pName[MAX_PLAYER_NAME], pKey[128], pSecKey[128], Float:pMoney, pScore, pLevel, pAdminLevel, }
Код:
dcmd_register(playerid, params[]) { new string[256]; (line 153) GetPlayerName(playerid, pData[playerid][pName], sizeof(pData[playerid][pName])); sscanf(params, "s", pData[playerid][pKey]); format(string, sizeof(string),"/accounts/%s.ini", pData[playerid][pName]); if(dini_Exists(string)) { SendClientMessage(playerid, RED, "[ERROR]: Account already exists. Please log in!"); return 1; } else { if(!isnull(params)) { dini_Create(pData[playerid][pName]); dini_Set(string, "pName", pData[playerid][pName]); dini_Set(string, "pKey", pData[playerid][pKey]); dini_FloatSet(string, "pMoney", 0); dini_IntSet(string, "pScore", 0); dini_IntSet(string, "pAdminLevel", 0); dini_Unset(string, "pSecKey"); } else SendClientMessage(playerid, RED, "The password field must not be empty!"); return 1; } return 1; }
Код:
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(28) : warning 201: redefinition of constant/macro (symbol "CMD") C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(153) : error 001: expected token: "]", but found "-identifier-" C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(153) : warning 215: expression has no effect C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(153) : error 001: expected token: ";", but found "]" C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(153) : error 029: invalid expression, assumed zero C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(153) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.