SA-MP Forums Archive
help me out a bit - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help me out a bit (/showthread.php?tid=201564)



help me out a bit - MestreKiller - 21.12.2010

when i do mute it appear
Server: Unknown command +
SendFMessageToAll(red,"MUTED: has been muted [reason: %s]",pName,reason); (it dosnt appear the name)+
it dosnt mute why?
pawn Код:
dcmd_mute(playerid,params[])
{
    new id,reason,pName[MAX_PLAYER_NAME],file[128];
    if(PInfo[playerid][Level] < 3) return 0;
    if(sscanf(params,"us",id,reason)) return SCM(playerid,orange,"USAGE: /mute [id][reason]");
    PInfo[id][Muted] = 1;
    GetPlayerName(id,pName,sizeof(pName));
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",pName);
    dini_IntSet(file,"Muted",1);
    SendFMessageToAll(red,"MUTED:%s has been muted [reason: %s]",pName,reason);
    return 1;
}



Re: help me out a bit - blackwave - 21.12.2010

Edited
pawn Код:
dcmd_mute(playerid,params[])
{
    new id,reason,pName[MAX_PLAYER_NAME],file[128],string[128];
    if(PInfo[playerid][Level] < 3) return 0;
    if(sscanf(params,"us",id,reason)) return SCM(playerid,orange,"USAGE: /mute [id][reason]");
    else
    {
    GetPlayerName(id,pName,sizeof(pName));
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",pName);
    dini_IntSet(file,"Muted",1);
    PInfo[id][Muted] = 1;
    format(string,sizeof(string),"MUTED:%s has been muted [reason: %s]",pName,reason);
    SendFMessageToAll(red, string);
    }
    return 1;
}



Re: help me out a bit - MestreKiller - 21.12.2010

Quote:
Originally Posted by Hoborific
Посмотреть сообщение
You didn't meet one of the requirements of the IF and you haven't added a statement for the IF and the return below that statement.
You sir are a idiot. you dont know what you are speaking about


Re: help me out a bit - Mikkel_Pedersen - 21.12.2010

I'm not using dcmd, but I saw a script using it, so I came to think about, did you remember this?:
pawn Код:
dcmd(mute,4,cmdtext);
Under
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
I am unaware if dcmd has been updated and doesn't need that anymore, or if you already added it (I just couldn't see if you added it or not, by the code you show) If that's the case, then sorry.


Re: help me out a bit - MestreKiller - 21.12.2010

Quote:
Originally Posted by Mikkel_Pedersen
Посмотреть сообщение
I'm not using dcmd, but I saw a script using it, so I came to think about, did you remember this?:
pawn Код:
dcmd(mute,4,cmdtext);
Under
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
I am unaware if dcmd has been updated and doesn't need that anymore, or if you already added it (I just couldn't see if you added it or not, by the code you show) If that's the case, then sorry.
yes i remeber that and i do have it


Re: help me out a bit - XePloiT - 21.12.2010

try this
pawn Код:
dcmd_mute(playerid,params[])
{
    new id,reason[128],pName[MAX_PLAYER_NAME],file[128];
    if(PInfo[playerid][Level] < 3) return 0;
    if(sscanf(params,"is[128]",id,reason)) return SCM(playerid,orange,"USAGE: /mute [id][reason]");
    PInfo[id][Muted] = 1;
    GetPlayerName(id,pName,sizeof(pName));
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",pName);
    dini_IntSet(file,"Muted",1);
    SendFMessageToAll(red,"MUTED:%s has been muted [reason: %s]",pName,reason);
    return 1;
}

public OnPlayerText(playerid,text[])
{
    if(PInfo[playerid][Muted]==1) return 0;
//...
    return 1;
}