trying to create fixveh and fixvehall commands
#1

Hello guys, I am trying to create the /fixveh and /fixvehall command so as an admin I could fix the vehicle I am entered in or all the vehicles , this is what I got

Код:
#include <a_samp>
#include <zcmd>

#define FILTERSCRIPT

#define COLOR_GREY  0x00000041

enum playervEnum {
	 pAdminLevel
}
new
   playerVariables[MAX_PLAYERS][playervEnum];
   
CMD:fixvehall(playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 2) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
    SetVehicleHealth(i, 1000.0);
    RepairVehicle(i);
    SendClientMessage(playerid, COLOR_GREY, "All vehicles fixed.");
    return 1;
    }
    return 1;
}


CMD:fixveh (playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 2) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(IsPlayerInAnyVehicle(playerid))
    {
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, COLOR_GREY, "   You have fixed your vehicle !");
    }
    return 1;
}
Errors !


Код:
C:\Documents and Settings\Attila\Desktop\server\filterscripts\fixveh.pwn(17) : warning 225: unreachable code
C:\Documents and Settings\Attila\Desktop\server\filterscripts\fixveh.pwn(17) : warning 217: loose indentation
C:\Documents and Settings\Attila\Desktop\server\filterscripts\fixveh.pwn(28) : warning 217: loose indentation
C:\Documents and Settings\Attila\Desktop\server\filterscripts\fixveh.pwn(28) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Attila\Desktop\server\filterscripts\fixveh.pwn(28) : error 017: undefined symbol "cmd_fixveh"
C:\Documents and Settings\Attila\Desktop\server\filterscripts\fixveh.pwn(28) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Attila\Desktop\server\filterscripts\fixveh.pwn(28) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#define COLOR_GREY  0x00000041

enum playervEnum
{
     pAdminLevel
};

new
   playerVariables[MAX_PLAYERS][playervEnum];

CMD:fixvehall(playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        SetVehicleHealth(i, 1000.0);
        RepairVehicle(i);
    }
    SendClientMessage(playerid, COLOR_GREY, "All vehicles fixed.");
    return 1;
}


CMD:fixveh (playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, COLOR_GREY, "   You have fixed your vehicle !");
    }
    return 1;
}
Reply
#3

Thank You VERY MUCH
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)