14.09.2014, 14:01
(
Последний раз редактировалось Ox1gEN; 15.09.2014 в 16:34.
)
So, someone've told me how to get it to work without adding anything into it, after I added another else statement then it got fucked up, I have two of these similiar things, here are the codes:
Don't mined the Giberish.
So bassicly here, it returns the correct thing but it also writes the thing that is outside of the loop, which I do not want it.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE && GetPlayerWeapon(playerid) == 41)
{
if(IsPlayerInAnyVehicle(playerid)) return SetPlayerArmedWeapon(playerid, 0);
else
{
if(ASpray[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "!?? ??? ?? ???? ?? ??є?? ??? ????? ?? ????");
else
{
new Float:x, Float:y, Float:z;
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(!GetVehiclePos(i, x, y, z)) continue;
else if(IsPlayerInRangeOfPoint(playerid, 10, x, y, z))
{
if(g_Timer == false)
{
SendClientMessage(playerid, 0xFF0000FF, "!????? ????? ?? ????, ??? ??? ????? ?? ? 15 ????? ??? ??????");
SetTimerEx("SprayTimer", 15000, false, "d", playerid);
g_Timer = true;
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "!?? ??? ????? ?????, ??? ??? 15 ????? ?????");
}
}
}
SendClientMessage(playerid, 0xFF0000FF, "!???? ???? ??? ??? ???");
}
}
}
return 1;
}
forward SprayTimer(playerid);
public SprayTimer(playerid)
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
new Float:x, Float:y, Float:z;
if(!GetVehiclePos(i, x, y, z)) continue;
if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z))
{
ShowPlayerDialog(playerid, DIALOG_CAR_SPRAY, DIALOG_STYLE_LIST, "????? ??? ????", "??? ???\n??? ????\n??? ????\n??? ???є\n??? ????\n??? ????\n??? ????\n", "?????", "?????");
g_Timer = false;
}
}
SendClientMessage(playerid, 0xFF0000FF, "??? ?? ??? ?????! ??? ?? є???? ?? ?????? ?????? ????.");
g_Timer = false;
ASpray[id] = false;
SentSpray[id] = false;
OSpray[playerid] = false;
return 1;
}
So bassicly here, it returns the correct thing but it also writes the thing that is outside of the loop, which I do not want it.