Get save corda - 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: Get save corda (
/showthread.php?tid=136230)
Get save corda -
Steven82 - 24.03.2010
How do i get the random cordds where a player will do like /plantbomb and then it finds players coordnates when he does the command?
Re: Get save corda -
V1ceC1ty - 24.03.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/plantbomb", true))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, 0xFFFFFFFF, "Bomb Planted.");
// Do other stuff
CreateExplosion(x, y, z, 12, 10)
}
return 0;
}
Something like that, but if you just copy and paste that it will create an explosion when you type the command so you need to add a timer or something.
Re: Get save corda -
[HiC]TheKiller - 24.03.2010
Quote:
Originally Posted by V1ceC1ty
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/plantbomb", true)) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SendClientMessage(playerid, 0xFFFFFFFF, "Bomb Planted."); // Do other stuff
CreateExplosion(x, y, z, 12, 10) } return 0; }
|
Read the post maybe?
ONTOPIC:
There isn't a really efficient way of getting random co-ordonates. You would firstly need to find a bunch of then in area's then when a player is close enough (Check using IsPlayerInRangeOfPoint) make it say a message "/disarm to disarm the planted bomb".
Re: Get save corda -
Steven82 - 24.03.2010
No like i want to when you do like /plantbomb the bomb get placed where the helll you did the command.
Re: Get save corda -
adsy - 24.03.2010
heres an airstrike filterscript:
Код:
#include <a_samp>
#define WHITE 0xFEFEFEFF
new Float:x;
new Float:y;
new Float:z;
forward airstriketimer();
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Airstrike 6.0v | Created by J.Rascall.");
print("--------------------------------------\n");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/airstrike", true) == 0) {
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
SendClientMessage(playerid, WHITE, "You have called an airstrike on your position!");
SendClientMessage(playerid, WHITE, "Move now, you have 10 seconds.");
SetTimer("airstriketimer", 10000, false);
return 1;
}
return 0;
}
public airstriketimer()
{
CreateExplosion(x+random(2), y+random(2), z+random(2), 10, 14.0);
}
public OnFilterScriptExit()
{
return 1;
}
Re: Get save corda -
Steven82 - 25.03.2010
Quote:
Originally Posted by Steven82
No like i want to when you do like /plantbomb the bomb get placed where the helll you did the command.
|
Why in the hell do you always post random things? that are not on topic!!!!
Re: Get save corda -
XGh0stz - 25.03.2010
Random Players I'm guessing...?
pawn Код:
new Random=random(Max_Players);
if(IsPlayerConnected(Random))
{
GetPlayerPos(Random,X,Y,Z);
// Do Whatever Code Here
}
OR... If you want to place the bomb at the feet of the command user then just:
pawn Код:
GetPlayerPos(playerid,X,Y,Z);
Re: Get save corda -
Steven82 - 25.03.2010
Quote:
Originally Posted by XGh0stz
Random Players I'm guessing...?
pawn Код:
new Random=random(Max_Players); if(IsPlayerConnected(Random)) { GetPlayerPos(Random,X,Y,Z); // Do Whatever Code Here }
OR... If you want to place the bomb at the feet of the command user then just:
pawn Код:
GetPlayerPos(playerid,X,Y,Z);
|
Thank you all i have been looking for thanks man.