4 Questions
#1

1. How would I make an air strike system (like airplanes use) when you type /airstrike, you have to wait 10 seconds, it will send a message saying
"move out of the way" and it will create a SMALL explosion where you wee standing where you were when you typed the command and it will say
"we have hit the target"?

2. How would I make a payday so every 20 min, each player gets 2,000 dollars and a message saying "you have received your pay"?

3. How would I make it so if a player types /landmine, it charges them -2,000 dollars, and when the next time a player walks over that area, BOOM!!!
Blood, gore, shit, fire everywhere! xD, anyway, when they walk over it, it explodes. (A SMALL EXPLOSION).

4. How would I make it so when a player spawns, it sets their health to 99999 and says "invincible" then after 6 seconds it says "no longer invincible and players health changes to 100%"?

If you can only answer one question, that's fine, thanks (I have searched for all this, found nothing and SA-MP WIKI doesn't help me much....)
Reply
#2

first you need to make a forward for the payday

we have it here:
pawn Код:
forward PayDay();
Then on OnGameModeInit() we make a timer on 20min
pawn Код:
SetTimer("PayDay",1200000,1);
Then the forward we made first is now a public, so we fill in the public.
pawn Код:
public PayDay()
{
    for (new i; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            new string[64];
            GivePlayerMoney(i,2000);
            format(string, sizeof(string), "You have received your payday on $2000");
            SendClientMessage(i, COLOR, string);
            SetTimer("PayDay",1200000,1);
        }
    }
}
Untested

That should work,

That'll be it, if it dont work try deleting the timer INSIDE the PayDay callback. then it only goes one time after the server startup
Reply
#3

< Topic Questions Updated (Not a bump) >
Reply
#4

Try this as a 6 sec invincible "god" thing.

First you make a forward in the top of your script
pawn Код:
forward invincible();
Then you make the timer
pawn Код:
SetTimerEx("invincible", 6000, false, "is", 1, "invincible timer");
if SetTimerEx doesnt work change it with
pawn Код:
SetTimer("invincible", 6000, 1);
Then you made at first a public out of that forward. now do
pawn Код:
public invincible()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        {
            SetPlayerHealth(i,100000);
        }
    }
    return 1;
}
Untested

Hope it helps, donno if it works. im really tired
Reply
#5

Quote:
Originally Posted by Niixie
Try this as a 6 sec invincible "god" thing.

First you make a forward in the top of your script
pawn Код:
forward invincible();
Then you make the timer
pawn Код:
SetTimerEx("invincible", 6000, false, "is", 1, "invincible timer");
if SetTimerEx doesnt work change it with
pawn Код:
SetTimer("invincible", 6000, 1);
Then you made at first a public out of that forward. now do
pawn Код:
public invincible()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        {
            SetPlayerHealth(i,100000);
        }
    }
    return 1;
}
Untested

Hope it helps, donno if it works. im really tired
This doesn't work cause the players health stays 100000 during the whole game, not just after he/ she spawns.
Reply
#6

<Longest time has pased. (Safe to bump) >
Reply
#7

(INVINCIBLE)
Try this:
After:
Quote:

SetPlayerHealth(i,100000);

do:
Quote:

SendClientMessage(i, COLOR_YELLOW, "HEREYOURTEXT");

That will make it show up in the chat only for the player.
But you have to change COLOR_YELLOW to a color you have
For the "You are not invincible anymore" i have no clue
Reply
#8

Quote:

This doesn't work cause the players health stays 100000 during the whole game, not just after he/ she spawns.

This Should be exactly what you need
Quote:

public invincible()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
SetPlayerHealth(i,100000);
SendClientMessage(i, COLOR, "HEREYOURTEXT");
SetTimer("Notinvinc", 6000, 0);
}
}
return 1;
}

Quote:

public Notinvinc ()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
SetPlayerHealth(i, 100);
SendClientMessage(i, COLOR, "HEREYOURTEXT");
}
}

REMEMBER TO CHANGE COLOR TO A GOOD COLOR AND CHANGE HEREYOURTEXT TO YOUR TEXT!!!!
Reply
#9

For scripting stuff you should read through the tutorial section in the samp wiki.
And also look at other peoples released filterscripts to get a good idea of how to script stuff like this.

The previous suggestions for spawn invincibility are kinda ridiculous and inefficient.

Here is the basics of how to do that, however i don't have pawno on me, so you will have to test it yourself:

Код:
forward SetPlayerSpawnHealth(playerid);
public OnPlayerSpawn(playerid)
{
  SetPlayerHealth(playerid,99999);
  SendClientMessage(playerid,0xFFFFFFFF, "spawned invincible");
  SetTimerEX("SetPlayerSpawnHealth",6000, "i", playerid);
}
public SetPlayerSpawnHealth(playerid)
{
  SetPlayerHealth(playerid,100);
  SendClientMessage(playerid,0xFFFFFFFF, "no longer invincible");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)