26.12.2008, 15:47
I don't know how to make local OOC and IC chat /l /b. Can someone help me please
if(strcmp(cmd, "/b", true) == 0)
{
new str[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
PlayerMessage(playerid, lime1, "/s [shout text]");
return 1;
}
format(str, sizeof(str), "((%s says : %s ))", name, result);
ProxDetector(15.0, playerid, str, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff);
return 1;
}
forward ProxDetector(Float:radi, playerid, string[], col1, col2, col3, col4, col5); // The forward
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) // The Callback
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i <=GetMaxPlayers();)
{
if(IsPlayerConnected(i))
{
if(!EarShot[i])
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
PlayerMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
PlayerMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
PlayerMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
PlayerMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
PlayerMessage(i, col5, string);
}
}
else
{
PlayerMessage(i, col1, string);
}
}
i++;
}
}
return 1;
}
C:\Users\Arturo\Desktop\FC-RP\Servidor\gamemodes\FC-RP.pwn(56) : error 017: undefined symbol "EarShot" C:\Users\Arturo\Desktop\FC-RP\Servidor\gamemodes\FC-RP.pwn(56) : warning 215: expression has no effect C:\Users\Arturo\Desktop\FC-RP\Servidor\gamemodes\FC-RP.pwn(56) : error 001: expected token: ";", but found "]" C:\Users\Arturo\Desktop\FC-RP\Servidor\gamemodes\FC-RP.pwn(56) : error 029: invalid expression, assumed zero C:\Users\Arturo\Desktop\FC-RP\Servidor\gamemodes\FC-RP.pwn(56) : fatal error 107: too many error messages on one line |