hel me /lock
|
|
Дата: 10.12.2010, Пятница, 19:13:15 | Сообщение # $NUMBER
Группа: Пользователи
Сообщений: 32
Не закрываются домашние и ренткаровские тачки вот собственно сам код 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_RED, "** Ó âàñ íåò ìàøèíû."); 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_RED, "** Ó âàñ íåò ìàøèíû."); 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_RED, "** Ó âàñ íåò ìàøèíû"); 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_RED, "** Ó âàñ íåò ìàøèíû"); 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_RED, "** Îøèáêà"); } } if(carid == 256) { SendClientMessage(playerid, COLOR_RED, "** Âû íå èìååòå ìàøèíû !"); } } return 1; }
|
|
|
Дата: 11.12.2010, Суббота, 11:11:34 | Сообщение # $NUMBER
Группа: Проверенные
Сообщений: 112
Drover, попробуй так Code 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_RED, "** У вас нет машины."); 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_RED, "** У вас нет машины."); 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_RED, "** У вас нет машины"); 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_RED, "** У вас нет машины"); 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_RED, "** Ошибка"); } } if(carid == 256) { SendClientMessage(playerid, COLOR_RED, "** Вы не имеете машины !"); } } return 1; }
|
|
|
Дата: 11.12.2010, Суббота, 16:50:30 | Сообщение # $NUMBER
Группа: Пользователи
Сообщений: 32
неработает пишет unknown comand
|
|
|