07.08.2011, 00:37
Hey guys,
I just made this command "/bonnet" and it's not working some how.
If anyone find the problem please help me, cause I get no error or warnings on the command, and the onlything I see is when I do only type "/bonnet" and not "/bonnet open"
I just made this command "/bonnet" and it's not working some how.
If anyone find the problem please help me, cause I get no error or warnings on the command, and the onlything I see is when I do only type "/bonnet" and not "/bonnet open"
pawn Код:
if(strcmp(cmdtext, "/bonnet", true) == 0)
{
new tmpcar;
new Message[256];
new strGatePosition[256];
strGatePosition = strtok(cmdtext, idx);
if(!strlen(strGatePosition))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /bonnet [open, close]");
return 1;
}
if(strcmp(strGatePosition,"open",true) == 0)
{
if(GetPlayerState(playerid) == 1)
{
tmpcar = GetClosestCar(playerid);
}
if(GetDistanceToCar(playerid,tmpcar) <= 4)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(tmpcar,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(tmpcar,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
format(Message, sizeof(Message), "* %s open the hood.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, Message, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else if(strcmp(strGatePosition,"close",true) == 0)
{
if(GetPlayerState(playerid) == 1)
{
tmpcar = GetClosestCar(playerid);
}
if(GetDistanceToCar(playerid,tmpcar) <= 4)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(tmpcar,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(tmpcar,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
format(Message, sizeof(Message), "* %s close the hood.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, Message, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}