HELP /EQUIP INSIDE DESIGNED CARS
#1

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
Reply
#2

Do you have an equip command from before?
Reply
#3

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
Reply
#4

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.
Reply
#5

Put your command in [ pawn ] [ /pawn ]
Reply
#6

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?
Reply
#7

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");
        }
    }
}
Reply
#8

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
Reply
#9

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");
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)