Random mission/ 2 question and one problem
#1

hi, I'm making taxi missions for my server, but I have a question and a problem....

first the first question:

FIXED

______________________________________-
My second question, has nothing to do with this mission thing, but I do not want to make a double topic...

so is there a possibility to call a self made function, under a callback? like
onplayerspawn
{
startminigame();
}
and then i can use somewhere in my script:
public startminigame();
is that possible? cuz I find it quiet stupid to make a timer of 1 second to call a selfmade callback...

__________________________________________________ _________________________

my problem:
if u look back at my mission script, u can see there's a textdraw wich should show up when a player enters the checkpoint, but when I enter the checkpoint I get the clientmessages and stuff, but no textdraw :/

__________________________________________________ ___________________________

thank you
Reply
#2

Put the text draw under OnGameModeInit()

Then place in your code

TextDrawShowForPlayer(playerid, textdarw);
Reply
#3

I see, I put the showtextdraw before it even was created -_-'
anyways, thanks alot.

What about the questions?
Reply
#4

I didnt reply to this because I though you could only do it with stocks

However you could try setting a timer when the player spawns, and killing it when they are in the minigame. However this may increase lag.
Reply
#5

well, in my stunt GM, i have used this as random gifts:
pawn Код:
public GivePlayerRandomGift()
  {
    new
    playerid,
    maxpls = GetMaxPlayers();
    do
    {
       playerid = random(maxpls);
    }
    while(!IsPlayerConnected(playerid));

    switch(random(10))
    {
    case 0:
    {
    GivePlayerMoney(playerid, 10000);
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: You got 10000 money!");
    Thank[playerid] = 1;
    }
    case 1:
    {
    SetPlayerArmour(playerid, 100.0);
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: You got free armour!");
    Thank[playerid] = 1;
    }
    case 2:
    {
    SetPlayerColor(playerid,0xFF66FFAA);
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: You are pink!");
    Thank[playerid] = 1;
    }
    case 3:
    {
    GivePlayerWeapon(playerid,38,5000);
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: You got a free minigun, rampage!");
    Thank[playerid] = 1;
    }
    case 4:
    {
    SetPlayerHealth(playerid, 100.0);
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: You got full health!");
    Thank[playerid] = 1;
    }
    case 5:
    {
    GivePlayerWeapon(playerid,34,10);
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: You got a free sniper!, rampage!");
    Thank[playerid] = 1;
    }
    case 6:
    {
    GivePlayerWeapon(playerid,8,1);
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: You got a free katana!, rampage!");
    Thank[playerid] = 1;
    }
    case 7:
    {
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: I'm sorry, but no gifts!");
    }
    case 8:
    {
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: No one got anything!");
    }
    default:
    {
    SendClientMessage(playerid,0xDEEE20FF, "Random gifts: No random gift!");
    }
   }
  }
but I don't think it will work...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)