SA-MP Forums Archive
HELP xD - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HELP xD (/showthread.php?tid=222426)



HELP xD - [M.A]Angel[M.A] - 07.02.2011

I need anti carjack in my server, so sometimes someone is drive and another one is steal his car this not fair can any one help me how to get anti carjack

For example:

IsAnyOneInVehicle ..OnPlayerEnterVehicle ( Slap player ) this what i need


Re: HELP xD - Matej_ - 07.02.2011

https://sampforum.blast.hk/showthread.php?tid=146885




Re: HELP xD - [M.A]Angel[M.A] - 07.02.2011

Quote:
Originally Posted by Matej_
Посмотреть сообщение
This will help you, download the script & take a look at the code:

https://sampforum.blast.hk/showthread.php?tid=146885

I look at thanks, but i dont need to someone put command for lockcar i need if player jackcar slap player anyways thanks.


Re: HELP xD - Matej_ - 07.02.2011

Quote:
Originally Posted by [M.A]Angel[M.A]
Посмотреть сообщение
slap player
pawn Код:
if(strcmp(cmd, "/slap", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_RED, "USAGE: /slap [playerid/PartOfName]");
                return 1;
            }
            new playa;
            new Float:slx, Float:sly, Float:slz;
            playa = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1  || IsPlayerAdmin(playerid))
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        new targetlevel = PlayerInfo[playa][pAdmin];
                        new playerlevel = PlayerInfo[playerid][pAdmin];
                        if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* You can not slap People that is higher Than You!");
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerPos(playa, slx, sly, slz);
                        PlayerPlaySound(playa, 1190, slx, sly, slz+8);
                        new y, m, d;
                        new h,mi,s;
                        getdate(y,m,d);
                        gettime(h,mi,s);
                        format(string, sizeof(string), "[Info:] You slaped %s",GetPlayerNameEx(playa));
                        SendClientMessage(playerid,COLOR_ADMINCMD,string);
                        format(string, sizeof(string), "[Info:] You have been slapped by %s",GetPlayerNameEx(playerid));
                        SendClientMessage(playa,COLOR_WHITE,string);
                        format(string, sizeof(string), "[Info:] %s have been slapped by %s",GetPlayerNameEx(playa),GetPlayerNameEx(playerid)); //editbs
                        SendClientMessageToAll(COLOR_ADMINDUTY,string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "** you are not authorized to use that command!");
            }
        }
        return 1;
    }
or

pawn Код:
dcmd_slap(playerid,params[])
{
    if(!PLVL[playerid]) return 0;
    new pid;
    if(PlayerInfo[playerid][pAdminLevel] >=1)
    {
        if(sscanf(params, "u", pid)) return SendClientMessage(playerid, Yellow, "Usage: /slap <playerid>");
        if(IsPlayerConnected(pid))
        {
        new Float:Pos[3], string[128], adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], moneys = strval(params);
        GetPlayerPos(pid,Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(pid,Pos[0],Pos[1],Pos[2]+moneys);
        format(string, sizeof(string), "Admin %s has slapped %s for %d meters", adminname, paramname, moneys);
        MessageToAdmins(AdminColor, string);
        } else SendClientMessage(playerid, Red, "This player is not connected");
    } else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
    return 1;
}



Re: HELP xD - Cameltoe - 07.02.2011

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
     if(IsAnyPlayerInVehicle(vehicleid))
     {
          ClearAnimations(playerid);
          SendClientMessage(playerid, 0x0FF, "Do not carjack ! :)");
          return 0;
     }
     return 1;
}



Re: HELP xD - [M.A]Angel[M.A] - 07.02.2011

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
     if(IsAnyPlayerInVehicle(vehicleid))
     {
          ClearAnimations(playerid);
          SendClientMessage(playerid, 0x0FF, "Do not carjack ! :)");
          return 0;
     }
     return 1;
}
error 017: undefined symbol "IsAnyPlayerInVehicle" pleaSe help


Re: HELP xD - [M.A]Angel[M.A] - 07.02.2011

HELP FROM ALL??


Re: HELP xD - Ironboy500[TW] - 07.02.2011

Click


Re: HELP xD - Ironboy500[TW] - 07.02.2011

If he followed that link, he would find following in one of samp forum topics.

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  for(new i; i < GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i))
    {
      if(IsPlayerInVehicle(i,vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerTeam(i) == GetPlayerTeam(playerid))
      {
	  SetPlayerHealth(playerid,0.00);
      }
    }
  }
  return 1;
}



Re: HELP xD - [M.A]Angel[M.A] - 08.02.2011

hmmm thanks to all btw failed? is exist antijackcar? i mean right OnPlayerEnterVehicle (If steal it and was player on) setplayerhealth 0 clinetmessege("Dont jackcars");
________________________

xXx StunT Paradise Awesome
\ /
\ Paradise Team /
\ /
\___________/
77.126.120.167:7777