24.03.2010, 07:07
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?
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;
}
Originally Posted by V1ceC1ty
pawn Код:
|
#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; }
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.
|
new Random=random(Max_Players);
if(IsPlayerConnected(Random))
{
GetPlayerPos(Random,X,Y,Z);
// Do Whatever Code Here
}
GetPlayerPos(playerid,X,Y,Z);
Originally Posted by XGh0stz
Random Players I'm guessing...?
pawn Код:
pawn Код:
|