CMD:n(playerid, params[]) { new string[172];//The string... if(isnull(params)) return SendClientMessage(playerid, lightblue, " /n [Text]"); //If the player only send '/admin'. new PlayerName[MAX_PLAYER_NAME+1]; //The string to store the name. GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); //We get the player name. format(string, sizeof(string), "[Near Messages]%s: %s", PlayerName, params); //The final message... SendNearMessage( playerid, COLOR_WHITE, string, 15.0 ); return 1; }
#if !defined isnull #define isnull(%1) \ ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) #endif
sscanf warning: Strings without a length are deprecated, please add a destination size. sscanf warning: Format specifier does not match parameter count. sscanf warning: Strings without a length are deprecated, please add a destination size. sscanf warning: Format specifier does not match parameter count.
CMD:n(playerid, params[]) { new string[128],msg[128],pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); if(sscanf(params,"sz",msg)) return SendClientMessage(playerid,COLOR_RED, " /n <Text>"); format(string,sizeof(string),"[Near Players Messages]%s: %s",pname,msg); SendNearMessage( playerid, COLOR_WHITE, string, 15.0 ); return 1; }
Shoe your sendnearmessage function as well as your current /n command
|
stock SendNearMessage(playerid, color, string[], Float:radius) { new Float:Position[3]; GetPlayerPos(playerid,Position[0],Position[1],Position[2]); for(new i; i <= MAX_PLAYERS; i++) { if(!IsPlayerConnected(playerid)) continue; if(IsPlayerInRangeOfPoint(i,radius, Position[0],Position[1],Position[2])) SendClientMessage(i, color, string); } return 1; }
CMD:v(playerid,params[]) { if(PlayerInfo[playerid][dRank] >= 1) { if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /v [text] - vip chat"); new string[128]; format(string, sizeof(string), "{FF00FF}Vip %s: %s", PlayerName2(playerid), params[0] ); for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][dRank] >= 1) { SendClientMessage(i,-1,string); } } return 1; } else return SendClientMessage(playerid,red,"ERROR: You need to be vip level 1 to use this command"); }