string help (not sure if it's possible) D:
#1

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
    if(CarSystem[vehicleid][cPerma] == 1)
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new string[128];
        format(string, sizeof(string), "%d",gLastCar[killerid]);
        if(PlayerInfo[i][pCarKeys] == string)
        PlayerInfo[i][pCarKeys] == 9999;
        DeleteCar(vehicleid);
        }
        return 1;
    }

When the vehicle is destroyed. I want the string to find what player online has the car keys (player owned vehicle) of the car destroyed.

That is how i am trying to check throughout the server who has the vehicle keys.
pawn Код:
format(string, sizeof(string), "%d",gLastCar[killerid]);
if(PlayerInfo[i][pCarKeys] == string)
I need to know what this line should be? D:
pawn Код:
if(PlayerInfo[i][pCarKeys] == string
Reply
#2

pawn Код:
if(PlayerInfo[i][pCarKeys] == gLastCar[killerid])
senseless to format an integer into a string if you just need the integer itself
Reply
#3

i love you
Reply
#4

1. hi marco
2. try something like this

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
 if(PlayerInfo[i][pCarKeys] == vehicleid)
 {
  PlayerInfo[i][pCarKeys] = 999;
 }
}
remember that the killerid of a vehicle may not necessarily be the one driving it
Reply
#5

Rob it's 8 am, /goto bed :P.

And thanks I already used Sascha's code
Reply
#6

kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk kkkkkkkkkkkkkkkkkkkkkkkk
and no i woke up like 20 mins ago - work omg
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)