[HELP] need a quick help
#1

I have made this command which creates explosion similar to /airstrike but i don't know how to get the position of player who uses this command can u help me please !


Код:
if (strcmp("/cannonfire", cmdtext, true, 10) == 0)
 {
   CreateExplosion(x, y, z, 6, 15);//cordinates to be written yet :D
   SendClientMessage(playerid, 0xFF0000FF, "Cannon fire on your position in 6 Seconds and counting!");
   return 1;
 }
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerPos
Reply
#3

pawn Код:
GetPlayerPos(playerid, FLoat:x, Float:y, FLoat:z);
Reply
#4

Quote:
Originally Posted by =WoR=Varth
Посмотреть сообщение
can you tell meh what will be the command then i am new to this !
Reply
#5

pawn Код:
public OnPlayerDisconnect(playerid)
{
    // This is used to save the players last postion and spawn him back when he joins again.
     new Float:x, Float:y, Float:z;
     GetPlayerPos(playerid, x, y, z);
      return 1;
}
Reply
#6

thx nilanjay but i want to add that in this code how to do this

Код:
if (strcmp("/cannonfire", cmdtext, true, 10) == 0)
 {
   if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1, "You dont have Enough Money For a Cannon Strike");
   CreateExplosion(, , , 6, 15);//cordinates to be written yet :D
   SendClientMessage(playerid, 0xFF0000FF, "Cannon fire on your position in 6 Seconds and counting!");
   GivePlayerMoney(playerid, -10000);//take his money
   return 1;
 }
i also want to add timer of 6 seconds !
Reply
#7

For timer you can see a tutorial
Reply
#8

I think you shoiuld make your current code like this
pawn Код:
if (strcmp("/cannonfire", cmdtext, true, 10) == 0)
 {
   if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1, "You dont have Enough Money For a Cannon Strike");
else
      {
          CreateExplosion(, , , 6, 15);//cordinates to be written yet :D
          SendClientMessage(playerid, 0xFF0000FF, "Cannon fire on your position in 6 Seconds and counting!");
          GivePlayerMoney(playerid, -10000);//take his money
      }
   return 1;
 }
Reply
#9

You are saying that when a player use the command then all the players should get a msg?
Reply
#10

Quote:
Originally Posted by nilanjay
Посмотреть сообщение
For timer you can see a tutorial
which 1 please post a link
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)