new Daniel; // a megnevezés nem számít, bármi lehet, de késõbb is azt használd
Daniel= AddStaticVehicle(...)
Daniel = AddStaticVehicle(451,1890.1632,1989.1708,13.4920,179.9223,6,6); // ez egy Turismo lesz az LV parkolóban
public OnPlayerStateChange(playerid, newstate, oldstate) { new PlayerName[24]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); if(newstate == PLAYER_STATE_DRIVER) { new Vehicle = GetPlayerVehicleID(playerid); if(Vehicle == Daniel) { if(strcmp(PlayerName,\"Daniel_Klaic\",true)){ // ellenõrizzük, hogy a játékos neve az-e, mint akinek a jármûvet készítettük RemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõl SendClientMessage(playerid, 0x33AA33AA, \"Ez a jármû Daniel_Klaic tulajdona!\"); // üzenetet dobunk neki } } } return 1;}
//a szkript elején:new Daniel;//az OnGameModeInit()-en vagy az OnFilterScriptInit()-en belül:Daniel = AddStaticVehicle(451,1890.1632,1989.1708,13.4920,179.9223,6,6);//OnPlayerStateChangepublic OnPlayerStateChange(playerid, newstate, oldstate) { new PlayerName[24]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); if(newstate == PLAYER_STATE_DRIVER) { new Vehicle = GetPlayerVehicleID(playerid); if(Vehicle == Daniel) { if(strcmp(PlayerName,\"Daniel_Klaic\",true)){ // ellenõrizzük, hogy a játékos neve az-e, mint akinek a jármûvet készítettük RemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõl SendClientMessage(playerid, 0x33AA33AA, \"Ez a jármû Daniel_Klaic tulajdona!\"); // üzenetet dobunk neki } } } return 1;}
if(strcmp(PlayerName, \"Hardy\", true) || strcmp(PlayerName, \"Freddy\", true) || strcmp(PlayerName, \"Cookie\", true))
public OnGameModeInit(){//Admin carsHardy = SetVehicleNumberPlate(AddStaticVehicle(562,2351.9514,1405.0309,42.4802,89.4359,0,0), \"HaRdY =]\");Maxi = SetVehicleNumberPlate(AddStaticVehicle(562,2351.8137,1412.0685,42.4790,88.3261,2,2), \"Maxi =]\");ReXxX = SetVehicleNumberPlate(AddStaticVehicle(562,2352.0625,1408.6031,42.4797,90.5892,1,1), \"ReXxX =]\");public OnPlayerStateChange(playerid, newstate, oldstate) {new PlayerName[24];GetPlayerName(playerid, PlayerName, sizeof(PlayerName));if(newstate == PLAYER_STATE_DRIVER) {new Vehicle = GetPlayerVehicleID(playerid);if(Vehicle == Hardy) {if(strcmp(PlayerName,\"e[X]tazy.HaRdY=]\",true)){ // ellenõrizzük, hogy a játékos neve az-eRemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõlSendClientMessage(playerid, 0x33AA33AA, \"Ezt a jármûvet csak HaRdY vezetheti!\");}}return 1;}GetPlayerName(playerid, PlayerName, sizeof(PlayerName));if(newstate == PLAYER_STATE_DRIVER) {new Vehicle = GetPlayerVehicleID(playerid);if(Vehicle == Maxi) {if(strcmp(PlayerName,\"e[X]tazy.Maxi=]\",true)){ // ellenõrizzük, hogy a játékos neve az-eRemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõlSendClientMessage(playerid, 0x33AA33AA, \"Ezt a jármûvet csak Maxi vezetheti!\");}}return 1;}GetPlayerName(playerid, PlayerName, sizeof(PlayerName));if(newstate == PLAYER_STATE_DRIVER) {new Vehicle = GetPlayerVehicleID(playerid);if(Vehicle == Durex) {if(strcmp(PlayerName,\"e[X]tazy.duReXxX=]\",true)){ // ellenõrizzük, hogy a játékos neve az-eRemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõlSendClientMessage(playerid, 0x33AA33AA, \"Ezt a jármûvet csak duReXxX vezetheti!\");}}}return 1;}
Nem úgy gondoltam hogy 1 jármûre...Jelen pillanatban így néz ki, de szerveren nem mûködik.: public OnGameModeInit(){//Admin carsHardy = SetVehicleNumberPlate(AddStaticVehicle(562,2351.9514,1405.0309,42.4802,89.4359,0,0), \"HaRdY =]\");Maxi = SetVehicleNumberPlate(AddStaticVehicle(562,2351.8137,1412.0685,42.4790,88.3261,2,2), \"Maxi =]\");ReXxX = SetVehicleNumberPlate(AddStaticVehicle(562,2352.0625,1408.6031,42.4797,90.5892,1,1), \"ReXxX =]\");public OnPlayerStateChange(playerid, newstate, oldstate) {new PlayerName[24];GetPlayerName(playerid, PlayerName, sizeof(PlayerName));if(newstate == PLAYER_STATE_DRIVER) {new Vehicle = GetPlayerVehicleID(playerid);if(Vehicle == Hardy) {if(strcmp(PlayerName,\"e[X]tazy.HaRdY=]\",true)){ // ellenõrizzük, hogy a játékos neve az-eRemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõlSendClientMessage(playerid, 0x33AA33AA, \"Ezt a jármûvet csak HaRdY vezetheti!\");}}return 1;}GetPlayerName(playerid, PlayerName, sizeof(PlayerName));if(newstate == PLAYER_STATE_DRIVER) {new Vehicle = GetPlayerVehicleID(playerid);if(Vehicle == Maxi) {if(strcmp(PlayerName,\"e[X]tazy.Maxi=]\",true)){ // ellenõrizzük, hogy a játékos neve az-eRemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõlSendClientMessage(playerid, 0x33AA33AA, \"Ezt a jármûvet csak Maxi vezetheti!\");}}return 1;}GetPlayerName(playerid, PlayerName, sizeof(PlayerName));if(newstate == PLAYER_STATE_DRIVER) {new Vehicle = GetPlayerVehicleID(playerid);if(Vehicle == Durex) {if(strcmp(PlayerName,\"e[X]tazy.duReXxX=]\",true)){ // ellenõrizzük, hogy a játékos neve az-eRemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõlSendClientMessage(playerid, 0x33AA33AA, \"Ezt a jármûvet csak duReXxX vezetheti!\");}}}return 1;} E: A rendszámok mûködnek, csak az nem hogy hiába nem én vagyok Maxi vagy ReXxX ugyan úgy tudom vezetni..
new Hardy;new Maxi;new ReXxX;
Hardy = AddStaticVehicle(562,2351.9514,1405.0309,42.4802,89.4359,0,0);Maxi = AddStaticVehicle(562,2351.8137,1412.0685,42.4790,88.3261,2,2);ReXxX = AddStaticVehicle(562,2352.0625,1408.6031,42.4797,90.5892,1,1);
public OnPlayerStateChange(playerid, newstate, oldstate){ new pName[24]; GetPlayerName(playerid, pName, 24); if(newstate == PLAYER_STATE_DRIVER) { if(GetPlayerVehicleID(playerid) == Hardy) { if(strcmp(pName, \"Hardy\", true)) { RemovePlayerFromVehicle(playerid);SendClientMessage(playerid, -1, \"Nem a tiéd az autó\"); }}else if(GetPlayerVehicleID(playerid) == Maxi){ if(strcmp(pName, \"Maxi\", true)) { RemovePlayerFromVehicle(playerid);SendClientMessage(playerid, -1, \"Nem a tiéd az autó\"); }}else if(GetPlayerVehicleID(playerid) == ReXxX){ if(strcmp(pName, \"ReXxX\", true)) { RemovePlayerFromVehicle(playerid);SendClientMessage(playerid, -1, \"Nem a tiéd az autó\"); }} } return 1;}