24.02.2010, 14:22
I want to make if you type a text only players who are close are reading and seeing it, this is the script:
I get this errors:
Код:
new string[256]; new sendername[MAX_PLAYER_NAME]; new sendername2[MAX_PLAYER_NAME]; new playername[MAX_PLAYER_NAME]; new cmd[256]; new tmp[256]; cmd = strtok(cmdtext, idx); GetPlayerName(playerid, sendername2, sizeof(sendername)); public OnPlayerText(playerid, text[]) { format(string,sizeof(string), "Command: %s: %s", sendername2, cmdtext); SendCmdMessage(COLOR_YELLOW, string); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) format(string, sizeof(string), "%s Says %s", sendername, result); ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); printf("%s", string); SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000); return 1; }
Код:
C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(17) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(30) : error 021: symbol already defined: "cmd" C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(32) : error 010: invalid function or declaration C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(36) : error 017: undefined symbol "cmdtext" C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(39) : error 017: undefined symbol "cmdtext" C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(40) : error 017: undefined symbol "idx" C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(40) : error 029: invalid expression, assumed zero C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(40) : error 029: invalid expression, assumed zero C:\Documents and Settings\Eigenaar\Bureaublad\LVRPG\gamemodes\test.pwn(40) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 8 Errors.