trying to create fixveh and fixvehall commands - 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)
+--- Thread: trying to create fixveh and fixvehall commands (
/showthread.php?tid=484240)
trying to create fixveh and fixvehall commands -
Jhony_Blaze - 29.12.2013
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.
Re: trying to create fixveh and fixvehall commands -
Konstantinos - 29.12.2013
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;
}
Re: trying to create fixveh and fixvehall commands -
Jhony_Blaze - 29.12.2013
Thank You VERY MUCH