How to make if i type it it'll show objects? - 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: How to make if i type it it'll show objects? (
/showthread.php?tid=549849)
How to make if i type it it'll show objects? -
Glossy42O - 09.12.2014
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(playerid, params[])
{
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;
}
Re: How to make if i type it it'll show objects? -
MasonSFW - 09.12.2014
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;
}
Re: How to make if i type it it'll show objects? -
Glossy42O - 09.12.2014
oh thanks.
Re: How to make if i type it it'll show objects? -
Beckett - 09.12.2014
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;
}