Few small questions :)
#1

'Ello!

First question: When I have following commands, /admins, /admin, /adminduty, /ann, /advert and all the other shit that start with a, how can I avoid the problem of some of them not working?

Like /admins does "Announcement: ins"(/ann).


Second question:

Why does these vehicles:
pawn Код:
AddStaticVehicle(411,2794.6809,1295.2672,10.4771,359.6819,64,1); // Spawn1 Infernus
    AddStaticVehicle(411,1374.6643,2696.5872,10.5474,358.7312,112,1); // Spawn2 Infernus
    AddStaticVehicle(520,1695.3934,1305.9945,10.5474,179.6371,64,1); // Spawn3 Hydra
Claim to be these:

pawn Код:
mc_launch1 = AddStaticVehicle(595, 919.67877197266, -3045.7512207031, 0.71859455108643, 260.30029296875, 4, 33); //
    mc_launch2 = AddStaticVehicle(595, 918.72479248047, -3051.8100585938, 0.84959363937378, 260.30029296875, 4, 33); //
All other vehicles but those 3 Spawn vehicles are named. Yet my "kick on enter if not in correct faction"-script kicks me out of the Spawn Vehicles if I ain't in the Navy(Launch's faction), and it says it's a Launch.


Third question:

Why doesn't this work? I obviously messed up but anyway. Nothing appears when I use it.

pawn Код:
if(!strcmp(cmdtext, "/spawnveh", true, 2))
    {
        if(!cmdtext[9])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnveh (Vehicle ID)");
        if(PlayerInfo[playerid][AdminJailed] == 1)return SendClientMessage(playerid, COLOR_GREY, "You cannot use commands in Admin Jail.");
        if(PlayerInfo[playerid][AdminLevel] > 2)
        {
          new
            Float:ax, Float:ay, Float:az, Float:angle;
            GetPlayerPos( playerid, ax, ay, az );
            GetPlayerFacingAngle(playerid, angle);
            CreateVehicle(cmdtext[10], ax+4, ay+4, az+1, angle, -1, -1, -1);
            return 1;
        }
        else
        {
          SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
        }
    }
Also, could someone please edit this to spawn the vehicles with defined colors? Like /spawnveh 411 126 1, and spawn it with colors 126 and 1.



Thanks, if anyone can take care/answer of some of these.
Reply
#2

Quote:
Originally Posted by IcyBlight
'Ello!

First question: When I have following commands, /admins, /admin, /adminduty, /ann, /advert and all the other shit that start with a, how can I avoid the problem of some of them not working?

Like /admins does "Announcement: ins"(/ann).
Are you sure the announcement command is "/ann". Check your script for something like "/ad" or "/adm" command.


Quote:
Originally Posted by IcyBlight
Second question:

Why does these vehicles:
pawn Код:
AddStaticVehicle(411,2794.6809,1295.2672,10.4771,359.6819,64,1); // Spawn1 Infernus
    AddStaticVehicle(411,1374.6643,2696.5872,10.5474,358.7312,112,1); // Spawn2 Infernus
    AddStaticVehicle(520,1695.3934,1305.9945,10.5474,179.6371,64,1); // Spawn3 Hydra
Claim to be these:

pawn Код:
mc_launch1 = AddStaticVehicle(595, 919.67877197266, -3045.7512207031, 0.71859455108643, 260.30029296875, 4, 33); //
    mc_launch2 = AddStaticVehicle(595, 918.72479248047, -3051.8100585938, 0.84959363937378, 260.30029296875, 4, 33); //
All other vehicles but those 3 Spawn vehicles are named. Yet my "kick on enter if not in correct faction"-script kicks me out of the Spawn Vehicles if I ain't in the Navy(Launch's faction), and it says it's a Launch.
This is probably a faulty 'IsAvehicletypehere' function

Quote:
Originally Posted by IcyBlight
Third question:

Why doesn't this work? I obviously messed up but anyway. Nothing appears when I use it.

pawn Код:
if(!strcmp(cmdtext, "/spawnveh", true, 2))
    {
        if(!cmdtext[9])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnveh (Vehicle ID)");
        if(PlayerInfo[playerid][AdminJailed] == 1)return SendClientMessage(playerid, COLOR_GREY, "You cannot use commands in Admin Jail.");
        if(PlayerInfo[playerid][AdminLevel] > 2)
        {
          new
            Float:ax, Float:ay, Float:az, Float:angle;
            GetPlayerPos( playerid, ax, ay, az );
            GetPlayerFacingAngle(playerid, angle);
            CreateVehicle(cmdtext[10], ax+4, ay+4, az+1, angle, -1, -1, -1);
            return 1;
        }
        else
        {
          SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
        }
    }
Also, could someone please edit this to spawn the vehicles with defined colors? Like /spawnveh 411 126 1, and spawn it with colors 126 and 1.
pawn Код:
if(!strcmp(cmdtext, "/spawnveh", true, 9)) //the number 9 here is for checking the first 9 characters on the command, so it will be triggered, when you type "/spawnveh"
{
    if(PlayerInfo[playerid][AdminLevel] <= 2)
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
        return 1;
    }
   
    if(!cmdtext[9])return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnveh (Vehicle ID)");
    if(PlayerInfo[playerid][AdminJailed] == 1)return SendClientMessage(playerid, COLOR_GREY, "You cannot use commands in Admin Jail.");
   
    new vehid[4]; //because the vehicle model id has 3 characters
    format(vehid, 4, "%s", cmdtext[10]); //getting the string which starts at index 10 and continues to where ever
   
    new id = strval(vehid);
    if (id < 400 || id > 612) //if It's an invalid model id
    {
        SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle model ID");
        return 1;
    }
     
    new
    Float:ax, Float:ay, Float:az, Float:angle;
    GetPlayerPos( playerid, ax, ay, az );
    GetPlayerFacingAngle(playerid, angle);
    CreateVehicle(id, ax+4, ay+4, az+1, angle, -1, -1, -1);
    return 1;
}
For the color thing, get a split function, like strtok(), sscanf() or split() which you get with the server package (check one of grandlarcs includes)
Reply
#3

I solved the first one, np.

Second one, here.

pawn Код:
if(vehid == mc_launch1 || mc_launch2)
        {
            if(PlayerInfo[playerid][Faction] != 6 && PlayerInfo[playerid][Faction] != 7 || PlayerInfo[playerid][Rank] < 2)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED , "[Faction Vehicle]: SA-Marines Launch - Rank 2+ only");
                return 1;
            }
        }
Third one, thanks
Reply
#4

pawn Код:
if(vehid == mc_launch1 || vehid == mc_launch2)
Reply
#5

Quote:
Originally Posted by dice7
pawn Код:
if(vehid == mc_launch1 || vehid == mc_launch2)
lmao.

Oh god I failed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)