01.11.2009, 16:42
What is wrong in this?
And i get 1 erroe and i warning
Please help
Код:
public OnPlayerLogin(playerid, Pass[]) { new Name[MAX_PLAYER_NAME], str[128]; GetPlayerName(playerid, Name, sizeof Name); format(str, sizeof str,"/Accounts/%s.txt", Name); new File:account = fopen(str, io_write); if(account) { new pass[256]; new passres[128], value[128]; fread(account, pass, sizeof pass); passres = GetFileString(pass); if (!strcmp("Password", passres)) { value = GetFileValue(pass); strmid(AccInfo[playerid][password], value, 0, strlen(value)-1, 128); } if (!strcmp(AccInfo[playerid][password], Pass, true)) { while (fread(account, pass, 256)) { passres = GetFileString(pass); if (strfind(passres, "AdminLevel") != -1) { value = GetFileValue(pass); AccInfo[playerid][AdminLevel] = strval(value); } if (strfind(passres, "Cash") != -1) { value = GetFileValue(pass); AccInfo[playerid][Cash] = strval(value); } fclose(account); AccInfo[playerid][Logged] = 1; } else { SendClientMessage(playerid, RED, "Incorrect Password."); fclose(account); return 1; } GivePlayerMoney(playerid, AccInfo[playerid][Cash]); format(str, sizeof str, "You have successfully logged in as %s", Name); SendClientMessage(playerid, GREEN, str); printf("%s has logged in", Name); if (AccInfo[playerid][AdminLevel] > 0) { format(str, sizeof str, "You are now logged in as a admin level [%d]", AccInfo[playerid][AdminLevel]); SendClientMessage(playerid, WHITE, str); } } } return 1; }
Код:
C:\Documents and Settings\Administrator\Desktop\Servers & Scripts\CroRoleplay\gamemodes\CroRoleplay.pwn(215) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\Servers & Scripts\CroRoleplay\gamemodes\CroRoleplay.pwn(221) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.