02.12.2009, 10:01
[b]
I did this:
[b]and get this error:
Quote:
Originally Posted by Awaran[Enemy-Plus
; ]
You are going to need strtok functions; strtok and bigstrtok pawn Код:
pawn Код:
pawn Код:
|
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[128]; new tmp[128]; new idx; new string[128]; cmd = strtok(cmdtext,idx); if(!strcmp(cmdtext, "/me", true, 3)) { if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]"); new str[128]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "* %s %s", str, cmdtext[4]); SendClientMessageToAll(0xFFFF00AA, str); if (strcmp("/pm", cmdtext, true, 3) == 0) { new message[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,CORAL,"USAGE: /pm [playerid] [message]"); SendClientMessage(playerid,CORAL,"FUNCTION: Sends a message to a player"); return 1; } targetid = strval(tmp); if(IsPlayerConnected(targetid)) { new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], str[128]; GetPlayerName(targetid,name,sizeof(name)); GetPlayerName(playerid,name2,sizeof(name2)); message = bigstrtok(cmdtext, idx); if(!strlen(message)) return SendClientMessage(playerid,CORAL,"USAGE: /pm [playerid] [message]"), SendClientMessage(playerid,CORAL,"You did not enter a message"); format(string,sizeof(string),"PM from %s(%d): %s",name2, playerid,message); SendClientMessage(targetid,YELLOW,string); format(str,sizeof(str),"PM sent to %s(%d): %s", name, targetid, message); SendClientMessage(playerid,YELLOW,str); //printf("[PM] %s[%d] to %s[%d] - %s -",name2, playerid, name, targetid, message);//Un-comment if you want these to be logged into the samp-log.txt } else if(!IsPlayerConnected(targetid)) { SendClientMessage(playerid,CORAL,"Invalid ID"); return 1; }
Код:
C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(136) : error 047: array sizes do not match, or destination array is too small C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(145) : warning 217: loose indentation C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(148) : warning 217: loose indentation C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(148) : error 047: array sizes do not match, or destination array is too small C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(151) : error 017: undefined symbol "CORAL" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(152) : error 017: undefined symbol "CORAL" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(155) : error 017: undefined symbol "targetid" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(156) : error 017: undefined symbol "targetid" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(158) : warning 219: local variable "str" shadows a variable at a preceding level C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(159) : error 017: undefined symbol "targetid" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(161) : error 017: undefined symbol "bigstrtok" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(161) : error 033: array must be indexed (variable "message") C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(162) : error 017: undefined symbol "CORAL" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(164) : error 017: undefined symbol "targetid" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(165) : error 017: undefined symbol "targetid" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(166) : error 017: undefined symbol "YELLOW" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(169) : error 017: undefined symbol "targetid" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(171) : error 017: undefined symbol "CORAL" C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(175) : warning 217: loose indentation C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(175) : error 029: invalid expression, assumed zero C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(175) : error 004: function "OnPlayerEnterVehicle" is not implemented C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(180) : warning 225: unreachable code C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(180) : error 029: invalid expression, assumed zero C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(180) : error 004: function "OnPlayerExitVehicle" is not implemented C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(185) : warning 225: unreachable code C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(185) : error 029: invalid expression, assumed zero C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(185) : error 004: function "OnPlayerStateChange" is not implemented C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(190) : warning 225: unreachable code C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(190) : error 029: invalid expression, assumed zero C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(190) : error 004: function "OnPlayerEnterCheckpoint" is not implemented C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(195) : warning 225: unreachable code C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(195) : error 029: invalid expression, assumed zero C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(195) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(200) : warning 225: unreachable code C:\DOCUME~1\ADMIN~1.GEO\Desktop\COPYOF~1\GAMEMO~1\Country.pwn(200) : error 029: invalid expression, assumed zero Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 26 Errors.