MessageBox + Welcome text + Commands help + Ban
#1

Hello,

I need help with those things I mentioned in title, so this is what I need/want


MessageBox
I need some kind of message box that looks like that one when you apply a cheat in singleplayer

WelcomeText
welcome text like "Welcome to our server" on the middle of the screen



something like this, there are both things, message box on the left and welcome message almost in the middle of the screen

Command + ban
Let's say I have command
Код:
/ban
now what I want is that it will check if there are 3 more words/values/parameters, for example
Код:
/ban 0 60 60 minute ban
this will ban player with ID 0 for 60 minutes with reason "60 minute ban", I know how to do bans (I want to do them via MySQL) but I need to know how to "separate" those values in /ban command and check if there are at least 3, so it will check if theres "0", "60" and at least one letter of reason, if yes then it will proceed to get value of first one and convert it to number, same with second one and it will get everything other as one string
Reply
#2

Quote:
Originally Posted by SEnergy
Посмотреть сообщение
MessageBox
I need some kind of message box that looks like that one when you apply a cheat in singleplayer
Use textdraws. This tutorial about textdraws should help you.

Quote:
Originally Posted by SEnergy
Посмотреть сообщение
WelcomeText
welcome text like "Welcome to our server" on the middle of the screen
https://sampwiki.blast.hk/wiki/GameTextForPlayer

Quote:
Originally Posted by SEnergy
Посмотреть сообщение
Command + ban
Let's say I have command
Код:
/ban
now what I want is that it will check if there are 3 more words/values/parameters, for example
Код:
/ban 0 60 60 minute ban
You have to use either Strcmp (Click me if you gonna use strcmp) or sscanf.

Quote:
Originally Posted by SEnergy
Посмотреть сообщение
(I want to do them via MySQL)
Read some tutorials about MySQL

https://sampforum.blast.hk/showthread.php?tid=337810
https://sampforum.blast.hk/showthread.php?tid=159785
https://sampwiki.blast.hk/wiki/Mysql_tutorial
Reply
#3

I will give a try to ban command ..
pawn Код:
CMD:ban(playerid,params[])
{
    if(pInfo[playerid][pAdmin]<2) return SendClientMessage(playerid,-1,"You aint allowed to use this");
    new targetid, time, reason[50];
    if(sscanf(params,"uI(0)s[50]",targetid,time,reason)) return SendClientMessage(playerid,-1,"Correct Usage : /ban id time reason");
    if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Invalid Id");    
    if(time<0) return SendClientMessage(playerid,-1,"Time can not be negatie");
    pInfo[targetid][Banned] = 1;
    new msg[200];
    format(msg,sizeof(msg),"You have banned %d for %s (time : %d)",targetid,reason,time);
    SendClientMessage(playerid,-1,msg);
    format(msg,sizeof(msg),"You have been banned by %d for %s (time : %d)",playerid,reason,time);
    SendClientMessage(targetid,-1,msg);
    if(time != 0) SetTimerEx("unban",time * 60 * 1000,false,"i",targetid);
    Kick(targetid);
    return 1;
}

forward unban(playerid);
public unban(playerid)
{
    //Open Player File
    pInfo[playerid][Banned] = 0;
    //Close file
    return 1;
}
Replace variables with your own.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)