Pickup auto repair
#1

Hello!

My auto repair when enter the pickupa does only works a couple of times, then it stops to auto repair total!

Here is the code:
pawn Код:
public pickup()
{
    newplayer = CreatePickup(3096,14,405.8782,2460.9792,17.2118,-1);
    airwolves = CreatePickup(3096,14,1619.4607,1337.4252,10.8095,-1);
    bluefoxes = CreatePickup(3096,14,1874.7584,-2288.3972,14.2586,-1);
    thunderbirds = CreatePickup(3096,14,-1372.7068,-214.9956,14.1484,-1);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == newplayer)
    {
        if(GetPlayerTeam(playerid) == 0) RepairVehicle(GetPlayerVehicleID(playerid));
        if(GetPlayerTeam(playerid) == 0)SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
    }
    if(pickupid == airwolves)
    {
        if(GetPlayerTeam(playerid) == 1) RepairVehicle(GetPlayerVehicleID(playerid));
        if(GetPlayerTeam(playerid) == 1)SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
    }
    if(pickupid == bluefoxes)
    {
        if(GetPlayerTeam(playerid) == 2) RepairVehicle(GetPlayerVehicleID(playerid));
        if(GetPlayerTeam(playerid) == 2)SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
    }
    if(pickupid == thunderbirds)
    {
        if(GetPlayerTeam(playerid) == 3) RepairVehicle(GetPlayerVehicleID(playerid));
        if(GetPlayerTeam(playerid) == 3)SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
    }
    return 1;
}
And why i dont have it like this, is bc i get spammed with "your vehicle has been repaired" at all pickups
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == newplayer)
    {
        if(GetPlayerTeam(playerid) == 0) RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
    }
    if(pickupid == airwolves)
    {
        if(GetPlayerTeam(playerid) == 1) RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
    }
    if(pickupid == bluefoxes)
    {
        if(GetPlayerTeam(playerid) == 2) RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
    }
    if(pickupid == thunderbirds)
    {
        if(GetPlayerTeam(playerid) == 3) RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
    }
    else SendClientMessage(playerid,0xFFFFFFFF,"You are not at your repair area!");
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == newplayer)
    {
        if(GetPlayerTeam(playerid) == 0)
        {   RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
            return 1;}
Reply
#3

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == newplayer)
    {
        if(GetPlayerTeam(playerid) == 0)
        {   RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, 0x33AA33AA, "Your vehicle has been repaired!");
            return 1;}
Thanks, i think it works correct and repair all the time now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)