06.04.2013, 03:30
how to fix the errors gave me alots of errors i tryed.
Код:
(505) : warning 219: local variable "pName" shadows a variable at a preceding level (579) : warning 219: local variable "pName" shadows a variable at a preceding level (644) : warning 219: local variable "pName" shadows a variable at a preceding level (709) : warning 219: local variable "pName" shadows a variable at a preceding level (740) : warning 219: local variable "pName" shadows a variable at a preceding level (4993) : warning 219: local variable "pName" shadows a variable at a preceding level (5015) : warning 219: local variable "pName" shadows a variable at a preceding level (5037) : warning 219: local variable "pName" shadows a variable at a preceding level (5130) : error 017: undefined symbol "LevelName" (5131) : error 017: undefined symbol "LevelName" (5153) : error 017: undefined symbol "IsVehicleOccupied" (5192) : error 017: undefined symbol "IsVehicleEmpty" 5301) : error 017: undefined symbol "FormatName" 5316) : error 017: undefined symbol "FormatName" (5345) : error 017: undefined symbol "FormatName" (5359) : error 004: function "SaveToLog" is not implemented c(5368) : error 079: inconsistent return types (array & non-array) (5370) : error 079: inconsistent return types (array & non-array) (5372) : error 017: undefined symbol "pName" (5373) : error 037: invalid string (possibly non-terminated string) (5373) : error 017: undefined symbol "Admin" (5373) : error 017: undefined symbol "has" (5373) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 15 Errors.
Код:
COMMAND:setname(playerid,params[]) { if (APlayerData[playerid][PlayerLevel] >= 7) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, 0xFF0000AA, "[USAGE]: /setname [playerid] [new name]"); new player1 = strval(tmp), length = strlen(tmp2), string[128]; if(length < 3 || length > MAX_PLAYER_NAME) return SendClientMessage(playerid, 0xFFFF00FF,"[ERROR]: Incorrect Name Length"); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { format(string, sizeof(string), "You have set %s's name to %s , pName(player1), tmp2); SendClientMessage(playerid,0xFF0000AA,string); if(player1 != playerid) { format(string,sizeof(string),"Admin %s has set your name to %s, pName(playerid), tmp2); SendClientMessage(player1, 0xFF0000AA, string); } SetPlayerName(player1, tmp2); new oldfile[64], newfile[64]; format(oldfile, sizeof(oldfile), "/ServerData/Players/%s.sav", udb_encode(pName(player1))); format(newfile, sizeof(newfile), "/ServerData/Players/%s.sav", udb_encode(tmp2)); fcopytextfile(oldfile, newfile); fremove(oldfile); } return 1; }