Help me make cmd (Vortex2) + rep
#1

So hello I need cmd who can only use by LSPD. Please help me out...
Reply
#2

pawn Code:
if(newstate == PLAYER_STATE_DRIVER) // In OnPlayerStateChange, when he just entered the vehicle.
{
    new skin = GetPlayerSkin(playerid);
    switch(GetVehicleModel(GetPlayerVehicleID(playerid))
    {
        case 427, 596, 598, 597, 599: // Here the vehicle models
        {
                if(skin != 280) // Add more skins yourself
                {
                    SendClientMessage(playerid, COLOR_RED, "You have to be a cop to enter this car!"); // Send a message he isn't a cop
                    RemovePlayerFromVehicle(playerid); // Remove him from the vehicle
                }
        }
    }
}
Reply
#3

So I have set all up but I have 1 error

Quote:

CMD:duty(playerid, params[]) {
if(IsPlayerConnected(playerid))
{
if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
{
if (PlayerToPoint(3, playerid,263.8386,109.0965,1004.6172) || PlayerToPoint(3,playerid,263.8386,109.0965,1004.61 72) || PlayerInfo[playerid][pLocal] != 255)
{
ShowPlayerDialog(playerid, DUTYMENU, DIALOG_STYLE_LIST, "LSPD Menu","Duty\nWeapons\nSWAT\nUniform\nUndercover", "Select", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a locker room !");
return 1;
}
}
if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
{
if(OnDuty[playerid]==0)
{
format(string, sizeof(string), "* EMT %s took a Badge from his bag.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GivePlayerWeapon(playerid, 42, 1000000);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1)
{
format(string, sizeof(string), "* EMT %s places his Badge in his bag.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
OnDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not a Cop or EMT!");
}
}
return 1;
}

Reply
#4

You will have to ident your code, this looks pretty much 'unreadable'. Also, which error did you get?
Reply
#5

Quote:
Originally Posted by trapped1
View Post
So I have set all up but I have 1 error
Considering I can easily tell this is taken from an NGG script.
You forgot to change something.

pawn Code:
if (PlayerToPoint(3, playerid,263.8386,109.0965,1004.6172) || PlayerToPoint(3,playerid,263.8386,109.0965,1004.61 72) || PlayerInfo[playerid][pLocal]
Change the "PlayerInfo" there at the end since you are not using that, you are using playerVariables


Also on that same line there is a space in your numbers. Find the space! *HINT* Its at the end of the code!
pawn Code:
PlayerToPoint(3,playerid,263.8386,109.0965,1004.61 72)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)