/refuelcars - 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: /refuelcars (
/showthread.php?tid=435810)
/refuelcars -
ryanhawk31 - 08.05.2013
It says Unknow Command
This is my command
pawn Код:
cmd:refuelcars(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] == 1)
{
VehicleInfo[i][pvFuel] = 100.0;
SendClientMessageToAll(COLOR_BLUE,"SERVER: All cars have been refilled!");
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"You have reffiled all cars!");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
Re: /refuelcars -
BenTaylorUK - 08.05.2013
Out of curiosity, you have more then one admin rank correct?
If so, you only have it set to accept the command if the admins level is 1, try this?
Код:
cmd:refuelcars(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
VehicleInfo[i][pvFuel] = 100.0;
SendClientMessageToAll(COLOR_BLUE,"SERVER: All cars have been refilled!");
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"You have refilled all cars!");
}
else return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}
Re : /refuelcars -
DaTa[X] - 08.05.2013
whatis [I] a loop ?
pawn Код:
cmd:refuelcars(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] == 1)
{//
for(new i=0; i< sizeof(VehicleInfo);i++){
VehicleInfo[i][pvFuel] = 100.0;
}//
SendClientMessageToAll(COLOR_BLUE,"SERVER: All cars have been refilled!");
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"You have reffiled all cars!");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}