Need a normal Local OOC chat command(/b) -
R3G1ST3R - 27.05.2011
For my server I just started using a Roleplay script that had no /b command, I tryed making it but I have everything, just not the actoull command
Respuesta: Need a normal Local OOC chat command(/b) -
admantis - 27.05.2011
pawn Code:
CMD:b(playerid, params[])
{
if (isnull(params)) return SendClientMessage(playerid, -1, "{C0C0C0}USAGE: /b < message >");
new Float:X, Float:Y, Float:Z, String[128], Name[25];
GetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, Name, 25);
format(String, 128, "(( [%d] %s: %s ))", playerid, Name, params);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerInRangeOfPoint(i, X, Y, Z))
{
SendClientMessage(playerid, 0xC0C0C0FF, String);
}
}
return true;
}
Re: Need a normal Local OOC chat command(/b) -
R3G1ST3R - 27.05.2011
I dont have Zcmd, can you make it with STRCMP? or whatever godfather(Carlito's roleplay) uses?
Re: Need a normal Local OOC chat command(/b) -
Elka_Blazer - 27.05.2011
pawn Code:
//Lame command man try using sscanf
if(strcmp(cmdtext,"/b",true) == 0)
{
new Float:X,Float:Y,Float:Z,str[128],name[MAX_PLAYER_NAME];
GetPlayerPos(playerid,X,Y,Z);
GetPlayerName(playerid,name,sizeof(name));
if(!strlen(cmdtext[3])) return SendClientMessage(playerid,0x999999ff,"Usage : /b [text]");
format(str,sizeof(str),"((%s : %s))",name,cmdtext[3]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,30.0,X,Y,Z))
{
SendClientMessage(i,0x999999ff,str);
}
}
return 1;
}
Re: Need a normal Local OOC chat command(/b) -
R3G1ST3R - 27.05.2011
error 035: argument type mismatch (argument 2) I get this error when I add the code into the script
Re: Need a normal Local OOC chat command(/b) -
Cjgogo - 27.05.2011
teh error line?
Re: Need a normal Local OOC chat command(/b) -
dannyk0ed - 27.05.2011
pawn Code:
(strcmp(cmd, "/b", true) == 0)//local ooc
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /b [local ooc chat]");
return 1;
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "Stranger Says: (( %s ))", result);
}
else
{
format(string, sizeof(string), "%s Says: (( %s ))", sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf("%s", string);
}
return 1;
}
Re: Need a normal Local OOC chat command(/b) -
R3G1ST3R - 27.05.2011
@danny C:\Documents and Settings\Jeremy\Desktop\samp\gamemodes\crp.pwn(180 6) : warning 217: loose indentation
C:\Documents and Settings\Jeremy\Desktop\samp\gamemodes\crp.pwn(180 6 -- 1807) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Jeremy\Desktop\samp\gamemodes\crp.pwn(180 7) : warning 217: loose indentation
C:\Documents and Settings\Jeremy\Desktop\samp\gamemodes\crp.pwn(181 5) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Jeremy\Desktop\samp\gamemodes\crp.pwn(181 5) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Jeremy\Desktop\samp\gamemodes\crp.pwn(181 5) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Jeremy\Desktop\samp\gamemodes\crp.pwn(181 5) : fatal error 107: too many error messages on one line
Re: Need a normal Local OOC chat command(/b) -
Captain Price - 27.05.2011
Your name is Jeremy!
Re: Need a normal Local OOC chat command(/b) -
R3G1ST3R - 27.05.2011
@captain, please do not "spam" on my topic, as in don't post if you don't have nothing usefull to say. thanks.