Кто знает как сделать чтоб ето оружие можно было использовать всем игрокам, а не токо одному,
потомучто сегодня тестил:
было 2 разные тачки и 2 игрока, я мог стрелять а он нет(( мож тут чтото нада изменить:
[pwn]
public GO()
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GUNMODE[playerid] == true)
{
if(IsPlayerConnected(playerid))
{
GetPlayerKeys(playerid,K,U,L);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(K == KEY_ANALOG_RIGHT){Long[playerid] += 15;
}
if(K == KEY_ANALOG_LEFT){Long[playerid] = STANDARTDISTANTION;
}
if(K == KEY_FIRE){GetVehiclePos(vehicleid, xx, yy, zz);GETPOS(playerid, xx, yy, Long[playerid]);CreateExplosion(xx, yy, zz, 10, 5.0);
}
if(Build[playerid] == 1){OBJEKT[playerid] = CreateObject(3267,X,Y,Z+0.5,RX,RY,RZ);Long[playerid] = STANDARTDISTANTION;AttachObjectToPlayer(OBJEKT[playerid], playerid, X, Y, Z+0.5, RX, RY, RZ);Build[playerid] = 0;
}
if(Build[playerid] == 2){DestroyObject(OBJEKT[playerid]);Build[playerid] = 0;
}
}
}
}
}
return 1;
}
Float:GETPOS(playerid, &Float:q, &Float:w, Float:distance)
{
new Float:a;GetVehiclePos(playerid, q, w, a);
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
else GetPlayerFacingAngle(playerid, a);q += (distance * floatsin(-a, degrees));w += (distance * floatcos(-a, degrees));return a;
}
stock IsCarForGun(id)
{
new GunCar[] =
{
400, 401, 405,
409, 410, 411, 412,
415, 419, 421, 422,
426, 429, 439, 442,
451, 458, 466, 467,
470, 475, 477, 478,
479, 480, 491, 492,
494, 496, 502, 503,
504, 506, 516, 517,
518, 526, 527, 529,
531, 533, 534, 535,
536, 539, 540, 541,
542, 543, 545, 546,
547, 549, 550, 551,
555, 558, 559, 560,
561, 562, 565, 566,
571, 572, 575, 576,
579, 580, 583, 585,
587, 589, 596, 597,
598, 599, 601, 602
};
for(new veh = 0; veh < sizeof(GunCar); veh++)
{
if(GetVehicleModel(id) == GunCar[veh])return 1;
}
[/pwn]