command wont work - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: command wont work (
/showthread.php?tid=206514)
command wont work -
yarrum3 - 04.01.2011
why wont this work
Код:
if(strcmp(cmd, "/car", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new x_nr[32];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /car [name]");
SendClientMessage(playerid, COLOR_GRAD1, "Available names: engine, lights, trunk, status, fuel");
return 1;
}
else if(strcmp(x_nr,"lights",true) == 0)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid ,engine,lights,alarm,doors,bonnet,boot,objective);
if (lights==1)
{
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
}
else
{
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
}
return 1;
}
sorry how it looks it all ways copy over to samp forum shit
Re: command wont work -
ToPhrESH - 04.01.2011
Post the error if you want us to help you ..
Re: command wont work -
yarrum3 - 04.01.2011
Quote:
Originally Posted by ToPhrESH
Post the error if you want us to help you ..
|
there no error it just wont trun on the lights
Re: command wont work -
Anthonyx3' - 04.01.2011
pawn Код:
if(strcmp(params, "Lights", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(veh != INVALID_VEHICLE_ID)
{
if(LightsStatus[playerid] == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
LightsStatus[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {2F991A}on!");
}
else if(LightsStatus[playerid] == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
LightsStatus[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's lights {E31919}off!");
}
}
}
else {
SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
}
}
basic for lights, change to your likings