SA-MP Forums Archive
Help me, Please - 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: Help me, Please (/showthread.php?tid=288702)



Help me, Please - seanny - 08.10.2011

Hello, I need the Following Commands in ZCMD and SScanf2

/adminchat
/kick
/ban
/ajail

Thats All, Thanks and I'll add your name to the Credits


Re: Help me, Please - iPLEOMAX - 08.10.2011

Post your Admin Variable names first!


Re: Help me, Please - seanny - 08.10.2011

But The Only Varible I have is pTazed which is nothing to do with admin system

Dont worry, I'll edit the code that I'm given and I'll post any errors that I get


Re: Help me, Please - Jafet_Macario - 08.10.2011

pawn Код:
CMD:adminchat(playerid, o[])
{
    if(isnull(o)) return SendClientMessage(playerid, -1,"Syntax Error: /adminchat [text]");
    new name[ MAX_PLAYER_NAME ], str[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(str,sizeof(str),"[Admin Chat] %s: %s", name, o);
    SendClientMessageToAll(-1, str);
    return true;
}

CMD:kick(playerid, o[])
{
    new id, reason[35], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], str[128];
    if(sscanf(o,"us[35]", id, reason)) return SendClientMessage(playerid, -1,"Syntax Error: /kick [PlayerName/ID] [Reason]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1,"This player is offline");
    GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, name2, sizeof(name2));
    format(str,sizeof(str),"|- %s has been kicked by %s. Reason:(%s) -|", name2, name, reason);
    SendClientMessageToAll(-1, str);
    Kick(id);
    return true;
}

YCMD:ban(playerid, o[])
{
    new id, reason[35], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], str[128];
    if(sscanf(o,"us[35]", id, reason)) return SCM(playerid, -1,"Syntax Error: /ban [PlayerName/ID] [Reason]");
    if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, -1,"This player is offline");
    GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, name2, sizeof(name2));
    format(str,sizeof(str),"|- %s has been banned by %s. Reason:(%s)", name2, name, reason);
    SendClientMessageToAll(-1, str);
    Ban(id);
    return true;
}

YCMD:ajail(playerid, o[])
{
    new id, reason[35], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], str[128];
    if(sscanf(o,"us[35]", id, reason)) return SCM(playerid, -1,"Syntax Error: /ajail [PlayerName/ID] [Reason]");
    if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, -1,"This player is offline");
    GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, name2, sizeof(name2));
    format(str,sizeof(str),"|- %s has been jailed by %s. Reason:(%s)", name2, name, reason);
    SendClientMessageToAll(-1, str);
    SetPlayerPos(playerid, ...); // Now set his pos to jail.
    return true;
}