28.09.2010, 13:17
These are the warnings :
And this is the onplayercommand current script :
And this is the script in the bottom of this whole script :
PHP код:
es\RP.pwn(505) : error 017: undefined symbol "strrest"
C:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\gamemodes\RP.pwn(505) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\gamemodes\RP.pwn(800) : warning 203: symbol is never used: "me"
PHP код:
new cmd[256],idx;
new tmp[256];
cmd = strtok(cmdtext,idx);
if(strcmp(cmd,"/Me",true)==0)
{
new string[256];
new name[24];
new Players = LimitGlobalChatRadius(10);
tmp = strrest(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,0xFF6C6CFF,"Usage: /me [action]");
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string)," [Me] %s : %s",name,tmp);
SendClientMessage(Players,0xFFFF00AA,string);
return 1;
}
PHP код:
stock ProxDetector(Float:radi, playerid, string[], color)
{
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(playerid, posx, posy, posz);
foreach (Player, i)
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
if(IsPlayerInRangeOfPoint(i,radi,posx, posy, posz))
{
SendClientMessage(i, color, string);
}
}
}
}
stock SendDoingMessage(playerid, doing[])
{
new Float: emoteX, Float: emoteY, Float: emoteZ, playerName[MAX_PLAYER_NAME], msg[128];
GetPlayerPos(playerid, emoteX, emoteY, emoteZ);
GetPlayerName(playerid, playerName, sizeof(playerName));
format(msg, sizeof(msg), "* %s %s", playerName, doing);
ProxDetector(30.0, playerid, msg, COLOR_PURPLE);
return 1;
}
CMD:me(playerid, params[])
{
new result[128];
if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /me [action]");
return SendDoingMessage(playerid, result);
}