public OnGameModeInit(){Dukma= AddStaticVehicle(490,423.3662,2489.3489,16.6132,88.2370,86,0);Dukma2= AddStaticVehicle(520,332.9124,2538.4272,17.5228,179.1386,86,86);Dukma3= AddStaticVehicle(579,422.4904,2484.5503,16.4090,90.4397,86,86);Dukma4= AddStaticVehicle(492,423.1748,2480.5828,16.2681,90.4548,86,86);return 1;}public OnPlayerStateChange(playerid, newstate, oldstate) { new PlayerName[24]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); if(newstate == PLAYER_STATE_DRIVER) { new Vehicle = GetPlayerVehicleID(playerid); if(Vehicle == Dukma) { if(strcmp(PlayerName,\"Freds_Dukma\",true)){ // ellenõrizzük, hogy a játékos neve az-e RemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõl SendClientMessage(playerid, 0x33AA33AA, \"Freds_Dukma tulajdona!\"); //amikor ki dobja ha nem az õvé } if(newstate == PLAYER_STATE_DRIVER) { if(Vehicle == Dukma) { if(strcmp(PlayerName,\"Freds_Dukma\",true)){ // ellenõrizzük, hogy a játékos neve az-e RemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõl SendClientMessage(playerid, 0x33AA33AA, \"Freds_Dukma tulajdona!\"); //amikor ki dobja ha nem az õvé } GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); if(newstate == PLAYER_STATE_DRIVER) { if(Vehicle == Dukma) { if(strcmp(PlayerName,\"Freds_Dukma\",true)){ // ellenõrizzük, hogy a játékos neve az-e RemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõl SendClientMessage(playerid, 0x33AA33AA, \"Freds_Dukma tulajdona!\"); //amikor ki dobja ha nem az õvé } GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); if(newstate == PLAYER_STATE_DRIVER) { if(Vehicle == Dukma) { if(strcmp(PlayerName,\"Freds_Dukma\",true)){ // ellenõrizzük, hogy a játékos neve az-e RemovePlayerFromVehicle(playerid); // ha nem õ az, kidobjuk a jármûbõl SendClientMessage(playerid, 0x33AA33AA, \"Freds_Dukma tulajdona!\"); //amikor ki dobja ha nem az õvé } } } return 1;}return 0;}}}}}}
new Dukma;new Dukma2;new Dukma3;new Dukma4;
Dukma = CreateVehicle(490,423.3662,2489.3489,16.6132,88.2370,86,0,-1);Dukma2 = CreateVehicle(520,332.9124,2538.4272,17.5228,179.1386,86,86,-1);Dukma3 = CreateVehicle(579,422.4904,2484.5503,16.4090,90.4397,86,86,-1);Dukma4 = CreateVehicle(492,423.1748,2480.5828,16.2681,90.4548,86,86,-1);
public OnPlayerStateChange(playerid, newstate, oldstate){new PlayerName[24]; // Létrehozzuk a PlayerName változót amiben tároljuk a nevünketnew vehicle = GetPlayerVehicleID(playerid); // a vehicle -t egyenlõvé tesszük a GetPlayerVehicleID(playerid); fgv.-elGetPlayerName(playerid, PlayerName, 24); // Lekérjük a nevünketif(newstate == PLAYER_STATE_DRIVER) // Ha vezetõ ülésre ülsz{ if(vehicle == Dukma) // ha az a jármû amiben ülsz megegyezik a Dukma 1 jármûvel { if(!strcmp(PlayerName, \"Freds_Dukma\", true)) // ha a te neved nem Freds_Dukma { SendClientMessage(playerid, -1, \"Nem viheted el ezt a jármûvet!\"); // üzenet RemovePlayerFromVehicle(playerid); // kidob a kocsiból }}else if(vehicle == Dukma2){ if(!strcmp(PlayerName, \"Freds_Dukma\", true)) { SendClientMessage(playerid, -1, \"Nem viheted el ezt a jármûvet!\"); RemovePlayerFromVehicle(playerid); }}else if(vehicle == Dukma3){ if(!strcmp(PlayerName, \"Freds_Dukma\", true)) { SendClientMessage(playerid, -1, \"Nem viheted el ezt a jármûvet!\"); RemovePlayerFromVehicle(playerid); }}else if(vehicle == Dukma4){ if(!strcmp(PlayerName, \"Freds_Dukma\", true)) { SendClientMessage(playerid, -1, \"Nem viheted el ezt a jármûvet!\"); RemovePlayerFromVehicle(playerid); }}}return 1;}
U.I.: Bocs az indentáció miatt eléggé ratyi a PAWN Kód beágyazás
if(vehicle == Dukma || vehicle == Dukma2 || vehicle == Dukma3 || vehicle == Dukma4){if(!strcmp(PlayerName, \"Freds_Dukma\", true)){SendClientMessage(playerid, -1, \"Nem viheted el ezt a jármûvet!\");RemovePlayerFromVehicle(playerid);}}
U.I.: Bocs az indentáció miatt eléggé ratyi a PAWN Kód beágyazás nem csak az azonosítás miatt ratyi elég felesleges az else if ág ha minden feltétel ugyanazt a kódot futtatja le... if(vehicle == Dukma || vehicle == Dukma2 || vehicle == Dukma3 || vehicle == Dukma4){if(!strcmp(PlayerName, \"Freds_Dukma\", true)){SendClientMessage(playerid, -1, \"Nem viheted el ezt a jármûvet!\");RemovePlayerFromVehicle(playerid);}} [/quote]ez alá kell? public OnPlayerStateChange(playerid, newstate, oldstate){
public OnPlayerStateChange(playerid, newstate, oldstate){
public OnPlayerStateChange(playerid, newstate, oldstate){ new PlayerName[24]; // Létrehozzuk a PlayerName változót amiben tároljuk a nevünket new vehicle = GetPlayerVehicleID(playerid); // a vehicle -t egyenlõvé tesszük a GetPlayerVehicleID(playerid); fgv.-el GetPlayerName(playerid, PlayerName, 24); // Lekérjük a nevünket if(newstate == PLAYER_STATE_DRIVER) // Ha vezetõ ülésre ülsz {if(vehicle == Dukma || vehicle == Dukma2 || vehicle == Dukma3 || vehicle == Dukma4){if(!strcmp(PlayerName, \"Freds_Dukma\", true)){SendClientMessage(playerid, -1, \"Nem viheted el ezt a jármûvet!\");RemovePlayerFromVehicle(playerid);}
public OnPlayerStateChange(playerid, newstate, oldstate){ new PlayerName[24]; new vehicle = GetPlayerVehicleID(playerid); GetPlayerName(playerid, PlayerName, 24); if(newstate == PLAYER_STATE_DRIVER) { if(vehicle == Dukma || vehicle == Dukma2 || vehicle == Dukma3 || vehicle == Dukma4) { if(!strcmp(PlayerName, \"Freds_Dukma\", true)) { SendClientMessage(playerid, -1, \"Nem viheted el ezt a jármûvet!\"); RemovePlayerFromVehicle(playerid); } } } return 1;}
if(!strcmp(PlayerName, \"Freds_Dukma\", true))
if(strcmp(PlayerName,\"Freds_Dukma\",true))