#include <a_samp> public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(\"/clean\", cmdtext, true)) new currveh = GetPlayerVehicleID(playerid); if(!IsPlayerAdmin(playerid) && !IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,\"Nem ülsz autóban/nem vagy admin\"); { DestroyVehicle(currveh); return 1; } return 0; }
Igen! Módosítottam mert hibás volt!
#include <a_samp>new pveh[MAX_PLAYERS];public OnPlayerCommandText(playerid,cmdtext[]){ if(strcmp(\"/clean\",cmdtext,true) ==0) { DestroyVehicle(pveh[playerid]); return 1; } return 0;}
pVeh[playerid] = CreateVehicle(.....);
public OnGameModeInit(){DisableInteriorEnterExits(); LoadMtaMap(\"ujobject.map\", true); SetTimer(\"idojaras\", 1200000, 1);CreatePickup(346, 2, 299.58, 3484.88, 8.89);CreatePickup(346, 2, 296.29, 3485.66, 8.89);CreatePickup(346, 2, 298.28, 3490.12, 8.89);CreatePickup(355, 2, 284.22, 3460.58, 11.36);CreatePickup(372, 2, 255.36, 3431.40, 7.63);CreatePickup(353, 2, 247.58, 3433.29, 7.63);CreatePickup(347, 2, 236.68, 3433.70, 7.63);CreatePickup(348, 2, 225.88, 3433.18, 7.63);CreatePickup(348, 2, 225.18, 3479.13, 5.96);CreatePickup(349, 2, 244.56, 3489.94, 5.96);pVeh[playerid] = CreateVehicle(.....); //dd2AddStaticVehicle(415,2978.0491,2686.8613,51.9541,269.7455,252,80); //AddStaticVehicle(415,2978.1541,2691.8931,51.9538,270.7289,252,8); //AddStaticVehicle(415,2978.1538,2697.8433,51.9525,269.6145,252,115); //AddStaticVehicle(415,2978.1960,2703.7500,51.9530,270.5028,252,68); //AddStaticVehicle(415,2989.0005,2686.8755,51.9513,90.8241,6,37); //AddStaticVehicle(415,2988.7183,2692.2515,51.9551,92.8159,6,43); //AddStaticVehicle(415,2988.5862,2697.6941,51.9535,89.9201,6,58); //AddStaticVehicle(415,2988.0986,2705.8442,51.9528,270.0262,6,85); //
new pVeh[MAX_PLAYERS];
pVeh[playerid] =
pVeh[playerid] = CreateVehicle(...paraméterek...);
Igen! Módosítottam mert hibás volt! f*szt módosítottál te kadaradam scriptjén :@ #include <a_samp>new pveh[MAX_PLAYERS];public OnPlayerCommandText(playerid,cmdtext[]){ if(strcmp(\"/clean\",cmdtext,true) ==0) { DestroyVehicle(pveh[playerid]); return 1; } return 0;} a lekérõben meg add oda a CreateVehicle(..) vagy AddStaticVehicle(..) elé, hogy pVeh[playerid] = CreateVehicle(.....); Ja és: ezt a kocsilekérõ scriptedbe rakd! vagyis abba amelyikbe benne van amikor lekéri(nem biztos hogy hibátlan, mert rögtönzötten írtam) [/quote]Nézzd meg egy kicsit jobban.. És majd meg láttod.
dcmd_car(playerid,params[]) {if(PlayerInfo[playerid][Level] >= 1) { new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index); if(!strlen(tmp)) return SendClientMessage(playerid, red, \"Használat: /car [Modellid/Név] [szín1] [szín2]\");new car, colour1, colour2, string[128]; if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);if(car < 400 || car > 611) return SendClientMessage(playerid, red, \"HIBA: nemlétezik ilyen modell vagy hibás a név\");if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid);LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);PlayerInfo[playerid][pCar] = LVehicleID;CMDMessageToAdmins(playerid,\"CAR\");format(string, sizeof(string), \"Admin %s Lerakott egy \\\"%s\\\"-t (Modell:%d) Szín (%d, %d), Ide %0.2f, %0.2f, %0.2f\", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z); SaveToFile(\"CarSpawns\",string);format(string, sizeof(string), \"Leraktál egy \\\"%s\\\"-t (Modell:%d) Szín (%d, %d)\", VehicleNames[car-400], car, colour1, colour2);return SendClientMessage(playerid,lightblue, string);} else return SendClientMessage(playerid,red,\"HIBA: Ehez a parancshoz legalább 1-es szintû adminnak kéne lenned!\");}
F:\\munkak\\lstdm.pwn(2847) : error 029: invalid expression, assumed zeroF:\\munkak\\lstdm.pwn(2847) : error 029: invalid expression, assumed zeroF:\\munkak\\lstdm.pwn(2847) : error 029: invalid expression, assumed zeroF:\\munkak\\lstdm.pwn(2847) : fatal error 107: too many error messages on one lineCompilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 4 Errors.
if (strcmp(\"/acar\", cmdtext, true, 10) == 0) { new vehicleid; DestroyVehicle(vehicleid); new Float:x,Float:y,Float:z, Float:a; GetPlayerPos(playerid,x,y,z); if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFB0000FF, \"HIBA: Te már jármûben ülsz!\");if(IsPlayerInVehicle(playerid, vehicleid)) SendClientMessage(playerid, 0x33AA33AA, \"Admin kocsi a tiéd!\");pVeh[playerid] = CreateVehicle(.....); CreateVehicle(502,x+1,y+1,z,a,0,3,1000); return 1; }
if(strcmp(\"/clean\",cmdtext,true) ==0) { DestroyVehicle(pveh[playerid]); return 1; } return 0;}return 0;}
CMD:v(playerid,params[]){new cars[256],Float:X,Float:Y,Float:Z,Float:angle,idx;cars = strtok(params,idx);if(isnull(params)) return SendClientMessage(playerid,-1,\"Használat: /v [Vehicleid]\");if(400 < strval(cars) > 600) return SendClientMessage(playerid,-1,\"Hibás ID! [400 - 611]\");if(kocsi[playerid] > 0) DestroyVehicle(kocsi[playerid]);if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,\"Neked már van kocsid!\");GetPlayerPos(playerid,X,Y,Z);GetPlayerFacingAngle(playerid,angle);kocsi[playerid] = CreateVehicle(strval(cars),X,Y,Z,angle,1,1,-1);PutPlayerInVehicle(playerid,kocsi[playerid],0);return 1;}