10.04.2010, 14:25
Quote:
Originally Posted by ruckfules99
Well heres a /suggest command i have in my script.
Code:
if(strcmp(cmd, "/suggest", true) == 0) { if(IsPlayerConnected(playerid)) { new sendername[MAX_PLAYER_NAME]; 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)) { SendClientMessage(playerid, COLOR_BLUE, "USAGE: /suggest [text]"); return 1; } new ip[16]; GetPlayerIp(playerid, ip, sizeof(ip)); format(szstring, sizeof(szstring), "name: %s, IP: %s, Suggestion: %s.",sendername,ip,(result)); SendClientMessage(playerid, COLOR_YELLOW, szstring); Suggestions(szstring); } return 1; } It saves the Players name, there IP and the suggestion into a textfile in scriptfiles folder. |
pawn Code:
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(665) : error 017: undefined symbol "cmd"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(672) : error 017: undefined symbol "idx"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(674) : error 017: undefined symbol "idx"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(674) : warning 215: expression has no effect
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(676) : error 017: undefined symbol "idx"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(678) : error 017: undefined symbol "idx"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(680) : error 017: undefined symbol "idx"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(681) : error 017: undefined symbol "idx"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(681) : warning 215: expression has no effect
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(683) : error 017: undefined symbol "idx"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(690) : error 017: undefined symbol "szstring"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(690) : error 017: undefined symbol "szstring"
C:\Users\USER\Desktop\Pawno\gamemodes\script.pwn(690) : error 029: invalid expression, assumed zero