In need of some scripting assistance..
#1

Hi,

Firstly, I am trying to redo the bank for the 'Land of Paradise' GM, I placed new map for it, was trying to use IEE entrance-exit, but couldn't quite understand it to work it, so decided to stick with its original /telebank system for now.

But since the original bank is actually just some 24/7 in the country, with a icon in it, when you walk over it, it says .. "type /bankhelp" etc etc, but how can I move that icon, or change it coords to be in the new bank?

Also, I have noticed, even if your not spawned and selecting a character, if you use the /telebank, it will teleport you to it, not character, but you'll see the screen and it sort of bugs selecting a character up, I am trying to counter that, I thought a command to check if the player has spawned, but I dont know what the command is, I was thinking like "IsPlayerSpawned" but I dont think it exists, right?
Reply
#2

You can use
pawn Код:
public OnPlayerSpawn(playerid)
To check if the player is spawned or not
Reply
#3

Hi,

I saw that one, but wasn't sure how to execute it, I mean, how can it tell, wouldn't it need if statements to?

Also, I just noticed problem #2, when at bank, you can use /home which teleports you back to your spawn, that command was always there and worked fine, but when using it from the bank, it seems like half the map goes weird, and you can see any spawned objects or anything
Reply
#4

It's a callback you just put it on your script.

Example of use

pawn Код:
public OnPlayerSpawn(playerid)
{
         if(IsPlayerAdmin(playerid))
         {
                   SendClientMessage(playerid, 0xFFFFFFFF, "Welcome back, Admin");
          }
          return 1;
}
Will give you message "Welcome back, Admin" when you spawned and logged in as RCON admin.
Reply
#5

Hmm, I'm not sure that's gonna work though.

See, I need to to detect if they player has not yet spawned, and is still either @ character selection or dead, and in which case, give an error message when trying to use /telebank.

OnPlayerspawn looks like what its to do when a player has spawned, right?

If you believe OnPlayerSpawn is still right for that, I will look more into it
Reply
#6

Using variable is the way then.

pawn Код:
new IsSpawned[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
        IsSpawned[playerid] = 1;
        return 1;
}

public OnPlayerDeath(playerid)
{
        IsSpawned[playerid] = 0;
        return 1;
}

//I assume you're using ZCMD
CMD:telebank(playerid, params[])
{
        if(IsSpawned[playerid] == 0) return SendClientMessage(playerid, -1, "You must be spawned to use this command")
        //Rest of your command
}
Reply
#7

awesome, that worked beautifully, any idea on how to move that icon for the bank though, or how to create one so when walked over, it says " blah blah blah Type /bankhelp?"..
Reply
#8

To move the icon i think you'll need a new coor and then change the coor inside the script.

To make the icon displays help.

pawn Код:
new bankpickup;

public OnGameModeInit()
{
      bankpickup = CreatePickup(1212, 2, Xpos, Ypos, Zpos, virtualworld); // This will create money pickup. Change Xpos Ypos Zpos and virtualworld with your coor.
      return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
      if(pickupid == bankpickup) return SendClientMessage(playerid, -1, "blah blah blah Type /bankhelp");
      return 1;
}
Reply
#9

Thank you so much, I will try it out

what about different icon, Is there a list of them, I either wanting a checkpoint or that "i" symbol..
Reply
#10

1239 is the ID of "i" symbol.

https://sampwiki.blast.hk/wiki/Pickup_ID%27s
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)