SA-MP Forums Archive
HELP /EQUIP INSIDE DESIGNED CARS - 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 /EQUIP INSIDE DESIGNED CARS (/showthread.php?tid=204009)



HELP /EQUIP INSIDE DESIGNED CARS - cacauagiar - 28.12.2010

Hello guys i am editing a server for me and my friends, and i am having trouble.

is it possible for me to make a /equip inside a car.

like the cops have enforcer soo they go inside the enforcer then they type /equip.
so they dont have to go all the way back to base and equip.

PLEASE HELP


Re: HELP /EQUIP INSIDE DESIGNED CARS - _rAped - 28.12.2010

Do you have an equip command from before?


Re: HELP /EQUIP INSIDE DESIGNED CARS - cacauagiar - 28.12.2010

Yes its like this

if(strcmp(cmd, "/equipcop", true) == 0)
{
if(PlayerToPoint(3, playerid,2300.1250,-1629.1116,14.653)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMembro] == 21 || PlayerInfo[playerid][pLider] == 21)//Cobras
{
format(string, sizeof(string), "* the cop %s is armed", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SetPlayerHealth(playerid, 100);
GivePlayerWeapon(playerid,24,200);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,5,1);
SendClientMessage(playerid,COLOR_GREEN,"you are ready to shoot some eggs");
return 1;
}
else
{
SendClientMessage(playerid, VERMELHO, "you are no t a cop");
}
}
}

please help i dnt sleep 4 2 nights lmfao


Re: HELP /EQUIP INSIDE DESIGNED CARS - _rAped - 28.12.2010

pawn Код:
if(strcmp(cmd, "/equipcop", true) == 0)
{
    if(PlayerToPoint(3, playerid,2300.1250,-1629.1116,14.653 || IsPlayerInAnyVehicle(playerid))
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(PlayerInfo[playerid][pMembro] == 21 || PlayerInfo[playerid][pLider] == 21)//Cobras
        {
            format(string, sizeof(string), "* the cop %s is armed", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
            SetPlayerHealth(playerid, 100);
            GivePlayerWeapon(playerid,24,200);
            GivePlayerWeapon(playerid,25,200);
            GivePlayerWeapon(playerid,5,1);
            SendClientMessage(playerid,COLOR_GREEN,"You are ready to shoot some eggs");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, VERMELHO, "You are not a cop");
        }
    }
}
Then you can add a check underneath that. To check if the player is in a cop vehicle.


Re: HELP /EQUIP INSIDE DESIGNED CARS - Tessar - 28.12.2010

Put your command in [ pawn ] [ /pawn ]


Re: HELP /EQUIP INSIDE DESIGNED CARS - cacauagiar - 28.12.2010

ok but i want it to be in a specific vehicle that they will only be able to equip inside that vehicle like they have 3 LVPD and 2 enforcer i want them to equip only inside the enforcer is it possible?


Re: HELP /EQUIP INSIDE DESIGNED CARS - _rAped - 28.12.2010

pawn Код:
if(strcmp(cmd, "/equipcop", true) == 0)
{
    if(PlayerToPoint(3, playerid,2300.1250,-1629.1116,14.653 || IsPlayerInAnyVehicle(playerid))
    {
        new vid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vid) != 247)
        {
            SendClientMessage(playerid, VERMELHO, "You have to be inside the enforcer to use /equip");
            return 1;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(PlayerInfo[playerid][pMembro] == 21 || PlayerInfo[playerid][pLider] == 21)//Cobras
        {
            format(string, sizeof(string), "* the cop %s is armed", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
            SetPlayerHealth(playerid, 100);
            GivePlayerWeapon(playerid,24,200);
            GivePlayerWeapon(playerid,25,200);
            GivePlayerWeapon(playerid,5,1);
            SendClientMessage(playerid,COLOR_GREEN,"You are ready to shoot some eggs");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, VERMELHO, "You are not a cop");
        }
    }
}



Re: HELP /EQUIP INSIDE DESIGNED CARS - cacauagiar - 28.12.2010

it compiled and everything but its not working D=

C:\Users\Moksovisk\Downloads\GamerX 3.3b\GamerX 3.3b\gamemodes\gamerx.pwn(23566) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size: 11756 bytes
Code size: 2228852 bytes
Data size: 8813932 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:11070924 bytes

1 Warning.



once again tanx for helping =B


Re: HELP /EQUIP INSIDE DESIGNED CARS - _rAped - 28.12.2010

Oh lolz.
pawn Код:
if(strcmp(cmd, "/equipcop", true) == 0)
{
    if(PlayerToPoint(3, playerid,2300.1250,-1629.1116,14.653) || IsPlayerInAnyVehicle(playerid))
    {
        new vid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vid) != 247)
        {
            SendClientMessage(playerid, VERMELHO, "You have to be inside the enforcer to use /equip");
            return 1;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(PlayerInfo[playerid][pMembro] == 21 || PlayerInfo[playerid][pLider] == 21)//Cobras
        {
            format(string, sizeof(string), "* the cop %s is armed", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
            SetPlayerHealth(playerid, 100);
            GivePlayerWeapon(playerid,24,200);
            GivePlayerWeapon(playerid,25,200);
            GivePlayerWeapon(playerid,5,1);
            SendClientMessage(playerid,COLOR_GREEN,"You are ready to shoot some eggs");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, VERMELHO, "You are not a cop");
        }
    }
}