new Jarmu[MAX_PLAYERS]; // DeklarálásJarmu[playerid] = CreateVehicle/AddStaticVehicle(Ex)(...); // A jármû létrehozásaDestroyVehicle(Jarmu[playerid]); // A létrehozott jármû törléseJarmu[playerid] = CreateVehicle/AddStaticVehicle(Ex)(...); // Új jármû létrehozása
new Jarmu[MAX_PLAYERS];
Jarmu[playerid] = CreateVehicle/AddStaticVehicle(Ex)(...);
CMD:infernus(playerid, params[]){ GetPlayerPos(...); CreateVehicle(...); return 1;}
CMD:infernus(playerid, params[]){ GetPlayerPos(...); Jarmu[playerid] = CreateVehicle(...); return 1;}
CMD:infernus(playerid, params[]){ GetPlayerPos(...); if(IsValidVehicle(Jarmu[playerid])) DestroyVehicle(Jarmu[playerid]); // ha van létrehozott jármûve, töröljük Jarmu[playerid] = CreateVehicle(...); return 1;}
public OnPlayerDisconnect(playerid, reason){ if(IsValidVehicle(Jarmu[playerid])) DestroyVehicle(Jarmu[playerid]); // ha van létrehozott jármûve, töröljük return 1;}
native IsValidVehicle(vehicleid);
CMD:leviathan(playerid, params []){new Float:X;new Float:Y;new Float:Z;new Float:A;GetPlayerPos(playerid,X,Y,Z);GetPlayerFacingAngle(playerid,A);Car = CreateVehicle(417,X,Y,Z,A,-1,-1,-1);PutPlayerInVehicle(playerid,Car,0);return 1;}
CMD:leviathan(playerid, params []){new Float:X;new Float:Y;new Float:Z;new Float:A;GetPlayerPos(playerid,X,Y,Z);GetPlayerFacingAngle(playerid,A);if(IsValidVehicle(Jarmu[playerid])) DestroyVehicle(Jarmu[playerid]);Jarmu[playerid] = CreateVehicle(417,X,Y,Z,A,-1,-1,-1);PutPlayerInVehicle(playerid,Jarmu[playerid],0);return 1;}
error 017: undefined symbol \"IsValidVehicle\"warning 215: expression has no effecterror 001: expected token: \";\", but found \")\"error 029: invalid expression, assumed zerofatal error 107: too many error messages on one line
Ha az IsValidVehicle függvényre hibát írna ki, írd a mod elejére: native IsValidVehicle(vehicleid);
#include a_samp#include zcmdnew Jarmu[MAX_PLAYERS];public OnPlayerDisconnect(playerid, reason) {if(GetVehicleModel(GetPVarInt(playerid, \"LastVeh\") != 0)) DestroyVehicle(GetPVarInt(playerid, \"LastVeh\"));return 1;}CMD:leviathan(playerid, params []) { new Float:pos[4]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetPlayerFacingAngle(playerid, pos[3]);if(GetVehicleModel(GetPVarInt(playerid, \"LastVeh\") != 0)) DestroyVehicle(GetPVarInt(playerid, \"LastVeh\")); Jarmu[playerid] = CreateVehicle(417, pos[0], pos[1], pos[2], pos[3], -1, -1, -1); PutPlayerInVehicle(playerid, Jarmu[playerid], 0);SetPVarInt(playerid, \"LastVeh\", Jarmu[playerid]); return 1;}