RespawnVehicle Doesnt work
#1

Hey, Everytime that they're /deliverwep and go to the checkpoint, I want the same car ; DeliverVehicles, will dessaper.


And this isnt, I put once (i) and this is respawning all the vehicle on server, how can I fix it?

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new szMessage[128];
    new vehicleid;
    if(PlayerInfo[playerid][pDeliverPlane] = 1 && IsPlayerInRangeOfPoint(playerid, 10,1968.79, -2492.85, 13.54))
    format(szMessage, sizeof(szMessage), "You have picked up the Illeagel Deliver for Crate and succed to transfer it to LS! ");
    SendClientMessageEx(playerid, COLOR_YELLOW, szMessage);
    DisablePlayerCheckpoint(playerid);
    PlayerInfo[playerid][pGunCrates] += 1;
    for(new i = 1; i <= MAX_VEHICLES; i++)
    {
    SetVehicleToRespawn(vehicleid);
    }
Reply
#2

Here you go
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new
        szMessage[ 128 ]
    ;
    if(PlayerInfo[ playerid ][ pDeliverPlane ] == 1 && IsPlayerInRangeOfPoint(playerid, 10,1968.79, -2492.85, 13.54))
    format( szMessage, sizeof( szMessage ), "You have picked up the Illeagel Deliver for Crate and succed to transfer it to LS! ");
    SendClientMessageEx( playerid, COLOR_YELLOW, szMessage );
    DisablePlayerCheckpoint( playerid );
    PlayerInfo[ playerid ][ pGunCrates ] ++; //instead of +=1;
    // removed the useless loop
    new vehicleid = GetPlayerVehicleID(playerid);
    SetVehicleToRespawn(vehicleid);
    return 1;
}
Reply
#3

Why did you remove the +=1?
Reply
#4

Quote:
Originally Posted by yaron0600
Посмотреть сообщение
Why did you remove the +=1?
++; it is like +1 but that's the right thing that you need to add in your code. (the correct way)
Reply
#5

When I compile it's says : Pawno stopped to work, maybe something worng in the code? Cause when I undo it compiled clean.
Reply
#6

Sorry, made a mistake there, forgot 2 brackets, try these code now

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new
        szMessage[ 128 ]
    ;
    if(PlayerInfo[ playerid ][ pDeliverPlane ] == 1 && IsPlayerInRangeOfPoint(playerid, 10,1968.79, -2492.85, 13.54))
    {
        format( szMessage, sizeof( szMessage ), "You have picked up the Illeagel Deliver for Crate and succed to transfer it to LS! ");
        SendClientMessageEx( playerid, COLOR_YELLOW, szMessage );
       
        DisablePlayerCheckpoint( playerid );
        PlayerInfo[ playerid ][ pGunCrates ] ++;
        new vehicleid = GetPlayerVehicleID( playerid );
        SetVehicleToRespawn( vehicleid );
    }
    return 1;
}
Reply
#7

Same...
Reply
#8

Any help?
Reply
#9

Hope it works for you
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new szMessage[128];
    if(IsPlayerInAnyVehicle(playerid))
    {
    new vehicleid = GetPlayerVehicle(playerid);
    }
    if(PlayerInfo[playerid][pDeliverPlane] = 1 && IsPlayerInRangeOfPoint(playerid, 10,1968.79, -2492.85, 13.54))
    format(szMessage, sizeof(szMessage), "You have picked up the Illeagel Deliver for Crate and succed to transfer it to LS! ");
    SendClientMessage(playerid, COLOR_YELLOW, szMessage);
    DisablePlayerCheckpoint(playerid);
    PlayerInfo[playerid][pGunCrates] += 1;
    SetVehicleToRespawn(vehicleid);
}
Reply
#10

Same...I need help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)