Script problems
#1

HELLO Community!

I have many idea of scripts but I don't know how make them.
Hope you can help me

a)I have a teamkill protection but It works only with people of the same class. Example: cops vs cops it works but cops vs swat it doesn't. I don't know how do that :S .

b)I'd like to see in the right of screen (where there is kills) when someone is coming or leaving. The icon is the id 200 and 201 in wepons id. https://sampwiki.blast.hk/wiki/Image:Weapon-200.gif

c)I don't understand how works the world boundaries. I know that it's SetPlayerWorldBounds (xmin,xmax,ymin,ymax).
But the problem is how to find the coordinates (xmin,xmax...) for LS only (example) ?

d)I did a menu called /shop here you can buy weapons... but the menu looks like the menu of transfender, me i want it looks like this one: /imageshack/i/samp007xh.png/ (With weapons).
And how to make menu appear if we enter marker?

e) How to make a simple /eject command in rustler/hydra (only)?

d)


Quote:
Originally Posted by ScottCFR
Посмотреть сообщение
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(Skin == SkinID)
    {
        for(new i = 0; i < 50; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][Skin] == 1)
                {
                    GameTextForPlayer(i, "You cannot spawn as that class", 5000, 5);
                    return 0;
                }
            }
        }
    }
    return 1;
}
Something like this should help. But, you'll need to edit it to fit your stuff.
Thank you ScottCFR That can help me too! But like you say I've to adapt it for my gamemode so can you explain me what means the lines of the code that will be great!

Now just thank you for help! I know there is many things, but i think that can help many peoples not only me
Reply
#2

For A:
I don't know.

For B:
pawn Код:
//onplayerdeath
SendDeathMessage(killerid, playerid, reason);
For C:
No download this and use it

Xtreme Vehicle Plotter

For D:
Use Dialogs, INPUT Dialogs and onplayertext

For E:
pawn Код:
//OnPlayerKeyStateChange
new state = GetPlayerState;
if(state == PLAYER_STATE_DRIVER)
{
        if(IsPlayerInVehicle(playerid) == 425 && 520)
        {
                 RemovePlayerFromVehicle(playerid);
         }
         return 1;
}
Reply
#3

Thank you for your help !
But you haven't understood at the E.
I explain i want when i (or a player)drive a rustler or a hydra when my plane is down before it explode I use the command /eject for be ejected in the sky with a parachute.

for B I've already this line i want to see when someone connect or leave the server. with the icon id 200 201.
(not in the main chat)
Ok thank you for answered so fast!
Reply
#4

Post the teamkill protection code.
Reply
#5

OK here is the code ask if you need something else


pawn Код:
#define TEAM_Cop 1
#define TEAM_Mafia 2
#define TEAM_Swat 3

static gTeam[MAX_PLAYERS];
forward SetPlayerToTeamColor(playerid);

Code:
public OnPlayerSpawn(playerid)
{

    SetPlayerToTeamColor(playerid);
    SetPlayerInterior(playerid,0);

   
    if(gTeam[playerid] == TEAM_Cop)
    {
   
    SetPlayerTeam(playerid,1);
    }
    else if(gTeam[playerid] == TEAM_Swat)
    {
   
    SetPlayerTeam(playerid,1);
    }
    else if(gTeam[playerid] == TEAM_Mafia)
    {
   
    SetPlayerTeam(playerid, 2);
    }

    return 1;
}
P.S : cops and swat have different colors on radar
Reply
#6

oh lol for E:

pawn Код:
//OnPlayerCommandText
if(strcmp(cmdtext, "/eject", true) == 0)
    {
        if(GetPlayerVehicleID(playerid) == 425 && 520)
        {
            new Float:X,Float:Y,Float:Z;
            RemovePlayerFromVehicle(playerid);
            GetPlayerPos(playerid,X,Y,Z);
            SetPlayerPos(playerid,X,Y,Z+5);
            GivePlayerWeapon(playerid,46,1);
            return 1;
        } else SendClientMessage(playerid,red,"You are not in a Hydra or Hunter");
        return 1;
    }
EDIT: Btw [ pawn ] Code Here [ /pawn ]

with out the spaced...
Reply
#7

No problem my fault.
You taught me something for that thank you!
Reply
#8

OK, no problem
Reply
#9

Oo it's not working i go in a rustler i do /eject he say me you are not in a fighter plane I'm sure rustler is id 476.
Maybe i have to replace X,Y,Z ?
( i ve modify your script i ve put rustler and change message to you are not in fighter plane)
Reply
#10

oh my bad lol

pawn Код:
if(strcmp(cmdtext, "/eject", true) == 0)
    {
        if(IsPlayerInAnyVehicle)
        {
            new Float:X,Float:Y,Float:Z;
            RemovePlayerFromVehicle(playerid);
            GetPlayerPos(playerid,X,Y,Z);
            SetPlayerPos(playerid,X,Y,Z+5);
            GivePlayerWeapon(playerid,46,1);
            return 1;
        } else SendClientMessage(playerid,red,"You are not in a vehicle");
        return 1;
    }
easier
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)