PDA

View Full Version : Help Me Error CMD :D


Desha1
10/01/2015, 08:07 PM
Hello guys
i have error in my cmd nitro
D:\fa\gamemodes\willsee.pwn(9499) : error 029: invalid expression, assumed zero
D:\fa\gamemodes\willsee.pwn(9499) : error 017: undefined symbol "cmd_nitro"
D:\fa\gamemodes\willsee.pwn(9499) : error 029: invalid expression, assumed zero
D:\fa\gamemodes\willsee.pwn(9499) : fatal error 107: too many error messages on one line
cmd
CMD:nitro(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You must be in a vehicle!");
AddVehicleComponent(GetPlayerVehicleID(playerid),1 010);
SendClientMessage(playerid,COLOR_LIGHTYELLOW,"Nitro added!"); //No idea what colour that is though.
return 1;
}
CMD i cant use it im Admin Lvl 8 why ?
CMD:setweather(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)
{
new string[128],weather;
if(sscanf(params, "i", weather)) return SendClientMessage(playerid, COLOR_ORCHID, "USAGE: /setweather [weatherid]");
if(weather > 45 || weather < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid weather ID.");
format(string,sizeof(string),"Administrator %s (%d) has setted all players weather to %d.",PlayerName(playerid),playerid,weather);
SendClientMessageToAll(COLOR_LIGHTRED,string);
SetWeather(weather);
}
else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
return 1;
}

acade
10/01/2015, 08:09 PM
AddVehicleComponent(GetPlayerVehicleID(playerid),1 010);

AddVehicleComponent(GetPlayerVehicleID(playerid,10 10);

Aswell as a missing } on the if

Which is the line?

Shaneisace
10/01/2015, 08:09 PM
You had a missing } for the if statement


CMD:nitro(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You must be in a vehicle!");
AddVehicleComponent(GetPlayerVehicleID(playerid),1 010);
SendClientMessage(playerid,COLOR_LIGHTYELLOW,"Nitro added!"); //No idea what colour that is though.
} // this was missing
return 1;
}

bgedition
10/01/2015, 08:09 PM
Do you have the include zcmd?

Desha1
10/01/2015, 08:15 PM
You had a missing } for the if statement


CMD:nitro(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You must be in a vehicle!");
AddVehicleComponent(GetPlayerVehicleID(playerid),1 010);
SendClientMessage(playerid,COLOR_LIGHTYELLOW,"Nitro added!"); //No idea what colour that is though.
} // this was missing
return 1;
}


i get error after i add it lol :(
dude im not dumb i have ZCMD inc

Desha1
10/01/2015, 08:20 PM
have this error again :(
D:\fa\gamemodes\willsee.pwn(9496) : error 029: invalid expression, assumed zero
D:\fa\gamemodes\willsee.pwn(9496) : error 017: undefined symbol "cmd_repair"
D:\fa\gamemodes\willsee.pwn(9496) : error 029: invalid expression, assumed zero
D:\fa\gamemodes\willsee.pwn(9496) : fatal error 107: too many error messages on one line
CMD:repair(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)
{
if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You are not in the driver seat!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, -1, "Your vehicle has been sucessfully repaired!");
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
return 1;
}

JuanStone
10/01/2015, 08:21 PM
What does this mean ? what rank could use the command 1-8 :neutral: ?

if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)

Desha1
10/01/2015, 08:23 PM
What does this mean ? what rank could use the command 1-8 :neutral: ?

if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)

1 can use it to rank 8 can use it
1 . 2 . 3. 4 . 5 . 6 . 7 . 8
to can use it

acade
10/01/2015, 08:27 PM
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)

That will not allow those ranks to use it.

You want if(PlayerInfo[playerid][pAdmin] >= 1)

That will let anyone of admin rank 1+ use it.

Yours allows anyone under and including rank 1 and rank 8 and above.

Desha1
10/01/2015, 08:28 PM
What does this mean ? what rank could use the command 1-8 :neutral: ?

if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)

im wrong now in this
i cant use it
i want it can use it from 1 to 8

acade
10/01/2015, 08:30 PM
im wrong now in this
i cant use it
i want it can use it from 1 to 8

if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)

That will not allow those ranks to use it.

You want if(PlayerInfo[playerid][pAdmin] >= 1)

That will let anyone of admin rank 1+ use it.

Yours allows anyone under and including rank 1 and rank 8 and above.

Check my post above yours.

Desha1
10/01/2015, 08:32 PM
now have this error :(
D:\fa\gamemodes\willsee.pwn(9494) : error 029: invalid expression, assumed zero
D:\fa\gamemodes\willsee.pwn(9494) : error 017: undefined symbol "cmd_repair"
D:\fa\gamemodes\willsee.pwn(9494) : error 029: invalid expression, assumed zero
D:\fa\gamemodes\willsee.pwn(9494) : fatal error 107: too many error messages on one line
CMD:repair(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pAdmin] >= 8)
if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You are not in the driver seat!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, -1, "Your vehicle has been sucessfully repaired!");
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
return 1;
}

JuanStone
10/01/2015, 08:34 PM
"#include <zcmd>"

work!

// This is a comment
// uncomment the line below if you want to write a filterscript


#define FILTERSCRIPT

#if defined FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define COLOR_LIGHTYELLOW (-1)
#define COLOR_LIGHTRED (-1)
#define COLOR_ORCHID (-1)
#define COLOR_RED (-1)

enum data
{
pAdmin
};

new PlayerInfo[MAX_PLAYERS][data];

CMD:nitro(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 9)
{
if(IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "Nitro added!");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "You must be in a vehicle!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "You are not administrator rank 1-8");
}
return true;
}

CMD:setweather(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 9)
{
new string[128];
if(sscanf(params, "i", params[0])) return SendClientMessage(playerid, COLOR_ORCHID, "USAGE: /setweather [weatherid]");
if(params[0] < 0 || params[0] > 45) return SendClientMessage(playerid, COLOR_RED, "Invalid weather ID.");
format(string,sizeof(string),"Administrator %s (%d) has setted all players weather to %d.",PlayerName(playerid),playerid, params[0]);
SendClientMessageToAll(COLOR_LIGHTRED, string);
SetWeather(params[0]);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "You are not administrator rank 1-8");
}
return 1;
}

CMD:repair(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 9)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, -1, "Your vehicle has been sucessfully repaired!");
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, -1, "You are not in the driver seat!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "You must be in a vehicle!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW, "You are not administrator rank 1-8");
}
return true;
}

stock PlayerName(playerid)
{
new name_player[24];
GetPlayerName(playerid, name_player, 24);
return name_player;
}

#endif