Erryn Geplaatst: 11 maart 2009 Rapport Geplaatst: 11 maart 2009 Kan iemand me hier mee helpen hoe kan ik dit alleen voor een huis auto laten werken if(strcmp(cmd, "/lock", true) == 0) { if(IsPlayerConnected(playerid)) { new carid; if (gTeam[playerid] == 2 || gTeam[playerid] == 1) { if(gLastCar[playerid] == 0 && PlayerInfo[playerid][pPhousekey] == 255) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle."); return 1; } else if(gLastCar[playerid] != 0 && gLastCar[playerid] != PlayerInfo[playerid][pPhousekey]+1) { if (HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] != 299) { gLastDriver[HireCar[playerid]] = 300; gCarLock[HireCar[playerid]] = 0; UnLockCar(HireCar[playerid]); } HireCar[playerid] = gLastCar[playerid]; } } if (PlayerInfo[playerid][pPhousekey] == 255) { if(HireCar[playerid] == 299) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle."); return 1; } } carid = PlayerInfo[playerid][pPhousekey]+1; if(HireCar[playerid] != 299 && !SwitchKey[playerid]) { carid = HireCar[playerid]; } //new driver = gLastDriver[carid]; new lockstatus = gCarLock[carid]; new Float:cx,Float:cy,Float:cz; GetVehiclePos(carid, cx, cy, cz); switch (lockstatus) { case 0: { if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle"); return 1; } if(HireCar[playerid] == carid && !SwitchKey[playerid]) { GameTextForPlayer(playerid, "~w~Hire Vehicle ~r~Locked", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); gCarLock[carid] = 1; LockCar(carid); } else if (PlayerInfo[playerid][pPhousekey] == carid-1) { GameTextForPlayer(playerid, "~w~House Vehicle ~r~Locked", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); gCarLock[carid] = 1; LockCar(carid); return 1; } } case 1: { if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle"); return 1; } if(HireCar[playerid] == carid && !SwitchKey[playerid]) { GameTextForPlayer(playerid, "~w~Hire Vehicle ~g~Unlocked", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); gCarLock[carid] = 0; UnLockCar(carid); } if (PlayerInfo[playerid][pPhousekey] == carid-1) { GameTextForPlayer(playerid, "~w~House Vehicle ~g~Unlocked", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); gCarLock[carid] = 0; UnLockCar(carid); return 1; } } default: { SendClientMessage(playerid, COLOR_GRAD2, " Error"); } } if(carid == 256) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle !"); } } return 1; } Reageren
thuron Geplaatst: 21 maart 2009 Rapport Geplaatst: 21 maart 2009 ik denk dat je dan je huisauto's een naam moet geven: housecar1 = Createvehicle(en alles hier) en die dan later in je script terug laten komen. isplayerinvehicle(playerid,housecar1) denk ik, maar dan zou ik nog ff naar wiki kijken voor de definities van isplayerinvehicle. Reageren
Recommended Posts
Een reactie plaatsen
Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.