30.12.2015, 12:38
Well, I couldn't really find the word to fit what I mean. I do /b Test and it will just send me the text syntax. It does this will all commands that require text after it, so. /b, /o, /kick, /ban, etc etc. Its all the commands that need text or an ID after the command for it to work. Single commands like /admins, /stats, /help work. I don't know how I can do this. I think it could be strtok but I am not sure.
Just incase;
Just incase;
pawn Код:
CMD:b(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SCM(playerid, COLOR_GREY, "** You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SCM(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
new result[128],y,m,d,h,mi,s;
getdate(y,m,d); gettime(h,mi,s);
if(sscanf(params, "s[128]", result)) return SCM(playerid, COLOR_GRAD2, "USAGE: /b [local ooc chat]");
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
format(tstring, sizeof(tstring), "(( Admin Says: %s ))", result);
}
if(PlayerInfo[playerid][pMod] == 1 && ModDuty[playerid] == 1)
{
format(tstring, sizeof(tstring), "(( Moderator Says: %s ))", result);
}
if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 1)
{
format(tstring, sizeof(tstring), "(( Stranger Says: %s ))", result);
}
if(PlayerInfo[playerid][pAdminDuty] == 0 && PlayerInfo[playerid][pMaskuse] == 0)
{
format(tstring, sizeof(tstring), "(( %s Says: %s ))", GPN(playerid), result);
}
ProxDetector(20.0, playerid, tstring,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
format(cstring, sizeof(cstring), "(%d/%d/%d)[%d:%d:%d] %s (Local OOC): %s",d,m,y,h,mi,s, GPN(playerid), result);
ChatLog(cstring);
}
return 1;
}