small thing need to fix - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: small thing need to fix (
/showthread.php?tid=334728)
small thing need to fix -
mineralo - 15.04.2012
ok, when I use this cmd its works + show unknow command by server what its wrong?
pawn Код:
if(strcmp(cmd,"/c",true) == 0)
{
if(PlayerInfo[playerid][pClanMem] == 250) return SendClientMessage(playerid,c_r,"( ! ) You're not in a clan !");
new string[250];
new clanf = PlayerInfo[playerid][pClanMem];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))return SendClientMessage(playerid, COLOR_WHITE, "( ! ) /c <message>");
if(Clans[clanf][Front] == 1)
{
if(PlayerInfo[playerid][pClanMem] == PlayerInfo[playerid][pClanKey])
{
format(string,sizeof(string),"( C ) Boss [%s]%s : %s",Clans[clanf][cName],PlayerName(playerid),result);
}
else
{
format(string,sizeof(string),"( C ) [%s]%s : %s",Clans[clanf][cName],PlayerName(playerid),result);
}
MessageToClan(playerid,GetPlayerColor(playerid),string);
return 1;
}
else
{
if(PlayerInfo[playerid][pClanMem] == PlayerInfo[playerid][pClanKey])
{
format(string,sizeof(string),"( C ) Boss %s[%s] : %s",PlayerName(playerid),Clans[clanf][cName],result);
}
else
{
format(string,sizeof(string),"( C ) %s[%s] : %s",PlayerName(playerid),Clans[clanf][cName],result);
}
MessageToClan(playerid,GetPlayerColor(playerid),string);
}
return 1;
}
stock MessageToClan(playerid,color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new clan = PlayerInfo[i][pClanMem];
if(IsPlayerConnected(i) == 1) if(clan == PlayerInfo[playerid][pClanMem]) SendClientMessage(i, color, string);
}
return 1;
}
Re: small thing need to fix -
mineralo - 15.04.2012
any one?
Re: small thing need to fix -
park4bmx - 15.04.2012
Have u tried "return 1" in the stock ?
Becouse ur only checking and formatting thins and the only thats left of a function is the stock!
Re: small thing need to fix -
Shetch - 15.04.2012
See if you're returning 0 at the end of OnPlayerCommandText. Also check your FSs and GMs.