How to make if i type it it'll show objects?
#1

Hello i'm making an earthquake system, mapped of course and how can i make after i type that command it will show the objects??

PHP код:
CMD:earthquake(playeridparams[])
{
 if(
IsPlayerAdmin(playerid))
 {
   
SendClientMessage(playerid, -1"You have started an earthquake event!");
 }
 else
 {
   return 
SendClientMessage(playerid, -1"{FF0000}You're not rcon administrator.");
 }
 return 
1;

Reply
#2

pawn Код:
CMD:earthquake(playerid, params[])
{
 if(IsPlayerAdmin(playerid))
 {
   SendClientMessage(playerid, -1, "You have started an earthquake event!");
   //Create your objects here, CreateObject(objectid, x, y, z); as you will make.
 }
 else
 {
   return SendClientMessage(playerid, -1, "{FF0000}You're not rcon administrator.");
 }
 return 1;
}
Reply
#3

oh thanks.
Reply
#4

Becareful if you do the command twice it'll duplicate the same objects so do the following.


pawn Код:
new earthquake;
CMD:earthquake(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        if(earthquake == 0)
        {
            SendClientMessage(playerid, -1, "You have started an earthquake event!");
            earthquake = 1;
            //createobject code here
        }
        else
        {
            SendClientMessage(playerid,-1,"Earthquake is already started.");
        }
    }
    else
    {
        return SendClientMessage(playerid, -1, "{FF0000}You're not rcon administrator.");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)