04.06.2010, 23:20
Ok, i've got my command but i'm having an issues with it. It sets the first color of the car just fine but it dosen't set the second color like it's suppose to what is the problem hear i belive i have everything right
Edit:
I'm also having problems with my lock command It locks the car just fine but if you teleport to somewhere then teleport back to your car it's unlocked
pawn Код:
if(!strcmp(tmp, "color",true,4))
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /v color [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 252) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 252 !"); return 1; }
tmp = strtok(cmdtext, idx);
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 252) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 252 !"); return 1; }
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !");
return 1;
}
new vehi = GetPlayerVehicleID(playerid);
if(VehicleInfo[vehi][vOwned] != 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle !");
return 1;
}
if(GetPlayerMoney(playerid) < 1000)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have $1000 to change your vehicle color !");
return 1;
}
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
if(strcmp(plname, VehicleInfo[vehi][vOwner], true) == 0)
{
VehicleInfo[vehi][vColorOne] = color1;
VehicleInfo[vehi][vColorOne] = color2;
SaveVehicles(playerid, vehi);
return 1;
}
}
I'm also having problems with my lock command It locks the car just fine but if you teleport to somewhere then teleport back to your car it's unlocked
pawn Код:
if(!strcmp(tmp, "lock",true,4))
{
if(ProxDetectorV(6, playerid, veh1[playerid]))
{
VehicleInfo[veh1[playerid]][vLock] = 1;
SetVehicleParamsForPlayer(veh1[playerid], playerid, 0, 1);
SaveVehicles(playerid, veh1[playerid]);
new str[256];
format(str, sizeof(str), "~w~%s ~r~locked", VehicleNames[GetVehicleModel(veh1[playerid])-400]);
GameTextForPlayer(playerid, str, 7000, 6);
return 1;
}
if(ProxDetectorV(6, playerid, veh2[playerid]))
{
VehicleInfo[veh2[playerid]][vLock] = 1;
SetVehicleParamsForPlayer(veh2[playerid], playerid, 0, 1);
SaveVehicles(playerid, veh1[playerid]);
new str[256];
format(str, sizeof(str), "~w~%s ~r~locked", VehicleNames[GetVehicleModel(veh2[playerid])-400]);
GameTextForPlayer(playerid, str, 7000, 6);
return 1;
}
if(ProxDetectorV(6, playerid, veh3[playerid]))
{
VehicleInfo[veh3[playerid]][vLock] = 1;
SetVehicleParamsForPlayer(veh3[playerid], playerid, 0, 1);
SaveVehicles(playerid, veh3[playerid]);
new str[256];
format(str, sizeof(str), "~w~%s ~r~locked", VehicleNames[GetVehicleModel(veh3[playerid])-400]);
GameTextForPlayer(playerid, str, 7000, 6);
return 1;
}
if(ProxDetectorV(6, playerid, veh4[playerid]))
{
VehicleInfo[veh4[playerid]][vLock] = 1;
SetVehicleParamsForPlayer(veh4[playerid], playerid, 0, 1);
SaveVehicles(playerid, veh4[playerid]);
new str[256];
format(str, sizeof(str), "~w~%s ~r~locked", VehicleNames[GetVehicleModel(veh4[playerid])-400]);
GameTextForPlayer(playerid, str, 7000, 6);
return 1;
}
if(ProxDetectorV(6, playerid, veh5[playerid]))
{
VehicleInfo[veh5[playerid]][vLock] = 1;
SetVehicleParamsForPlayer(veh5[playerid], playerid, 0, 1);
SaveVehicles(playerid, veh5[playerid]);
new str[256];
format(str, sizeof(str), "~w~%s ~r~locked", VehicleNames[GetVehicleModel(veh5[playerid])-400]);
GameTextForPlayer(playerid, str, 7000, 6);
return 1;
}
}