My carcheck
#1

Ok, I've got a Public carcheck for my ownable carsystem and what i wanna do is make it so i can own more then 1 car, I know this is configurable through carcheck cause i made another carcheck which was called carcheck1 i wa able to buy other cars but i had to go and make new commands for it, I don't wanna have to do that. I wanna make is so if you type the command it does whatever it is and it does it to that vehicle.

For example i do /park in my first owned vehicle, It parks it at that location

then i do /park in my second vehicle it parks it at that location

same with lock nshit. (i will set a switchkey for it so you can either control your first car or your second car)

Ok, so i wanna make this car check so there is a pCkey and a pCKey1, So i some how need to do it 2x

pawn Код:
public Carcheck(playerid)
{
new playername[32];
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCKey] != 0 && strcmp(playername, CInfo[PlayerInfo[playerid][pCKey]-1][cOwner], true) == 0)
{
return 1;
}
PlayerInfo[playerid][pCKey] = 0;
return 1;
}
I tried it like this but i got invaild fuction or decrtaion, Or it was somthing like that
pawn Код:
public Carcheck(playerid)
{
new playername[32];
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCKey] != 0 && strcmp(playername, CInfo[PlayerInfo[playerid][pCKey]-1][cOwner], true) == 0)
{
return 1;
}
PlayerInfo[playerid][pCKey] = 0;
return 1;
}
if(PlayerInfo[playerid][pCKey1] != 0 && strcmp(playername, CInfo[PlayerInfo[playerid][pCKey1]-1][cOwner], true) == 0)
{
return 1;
}
PlayerInfo[playerid][pCKey1] = 0;
return 1;
}
Reply
#2

pawn Код:
public Carcheck(playerid)
{
    new playername[32];
    GetPlayerName(playerid, playername, sizeof(playername));
    if(PlayerInfo[playerid][pCKey] != 0 && strcmp(playername, CInfo[PlayerInfo[playerid][pCKey]-1][cOwner], true) == 0)
    {
        return 1;
    }
    PlayerInfo[playerid][pCKey] = 0;
    if(PlayerInfo[playerid][pCKey1] != 0 && strcmp(playername, CInfo[PlayerInfo[playerid][pCKey1]-1][cOwner], true) == 0)
    {
        return 1;
    }
    PlayerInfo[playerid][pCKey1] = 0;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)