CMD:me(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
if(AntiAdv(playerid, params)) return 1;
format(string, sizeof(string), "* %s %s", RPN(playerid), params);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
CMD:do(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
if(AntiAdv(playerid, params)) return 1;
format(string, sizeof(string), "* %s (( %s ))", params, RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(!IsPlayerLoggedIn(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
return 0;
}
return 1;
}
CMD:me(playerid, params[])
{
if(AntiAdv(playerid, params[]))
return 1;
if(strlen(params) < 3) // if the "action" in the /me command was less than 3 characters in length, the command won't process
return 1;
new
string[144];
format(string, sizeof(string), "* %s %s", RPN(playerid), params);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
CMD:do(playerid, params[])
{
if(AntiAdv(playerid, params[]))
return 1;
if(strlen(params) < 3) // if the "description" in the /do command was less than 3 characters in length, the command won't process
return 1;
new
string[144];
format(string, sizeof(string), "* %s (( %s ))", params, RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
SendCustomPlayerMessage(Float:radi, playerid, text[], col1, col2, col3, col4, col5)
{
if(strlen(text) > 98)
{
new text1[99],
text2[99],
string[196];
strmid(text2, text, 98, 196);
strmid(text1, text, 0, 98);
format(string, 196, "%s...", text1);
ProxDetector(radi, playerid, string, col1, col2, col3, col4, col5);
format(string, 196, "...%s", text2);
ProxDetector(radi, playerid, string, col1, col2, col3, col4, col5);
}
else ProxDetector(radi, playerid, text, col1, col2, col3, col4, col5);
}
SendNearbyMessage
SendCustomPlayerMessage
Here.
pawn Код:
pawn Код:
pawn Код:
|
stock SendCustomPlayerMessage(Float:radi, playerid, text[], col1, col2, col3, col4, col5)
{
if(strlen(text) > 98)
{
new text1[99],
text2[99],
string[196];
strmid(text2, text, 98, 196);
strmid(text1, text, 0, 98);
format(string, 196, "%s ...", text1);
ProxDetector(radi, playerid, string, col1, col2, col3, col4, col5);
format(string, 196, "... %s", text2);
ProxDetector(radi, playerid, string, col1, col2, col3, col4, col5);
}
else ProxDetector(radi, playerid, text, col1, col2, col3, col4, col5);
}
CMD:me(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
if(AntiAdv(playerid, params)) return 1;
format(string, sizeof(string), "* %s %s", RPN(playerid), params);
SendCustomPlayerMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(637) : error 017: undefined symbol "ProxDetector"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(640) : error 017: undefined symbol "ProxDetector"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(642) : error 017: undefined symbol "ProxDetector"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(625) : warning 203: symbol is never used: "col5"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(625) : warning 203: symbol is never used: "col4"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(625) : warning 203: symbol is never used: "col3"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(625) : warning 203: symbol is never used: "col2"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(625) : warning 203: symbol is never used: "col1"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(625) : warning 203: symbol is never used: "playerid"
C:\Users\Iuly\Desktop\Desk\Sictir RolePlay\gamemodes\ZRP.pwn(625) : warning 203: symbol is never used: "radi"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
CMD:me(playerid, arg[]) { if(isnull(arg)) return SendClientMessageToAll(0xFF00FFFF, "Usage /me Does Some Action"); new line[128]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(line, sizeof(line), "%s %s", name, arg); return SendClientMessageToAll(0xFF00FFFF, line); }
CMD:do(playerid, arg[]) { if(isnull(arg)) return SendClientMessageToAll(0xFF00FFFF, "Usage /do Does Some Action"); new line[128]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(line, sizeof(line), "%s %s", name, arg); return SendClientMessageToAll(0xFF00FFFF, line); }
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
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 < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
}
return 1;
}
you need this aswell.
pawn Код:
|