#include a_samp#include sscanf2#include zcmdCMD:jump(playerid, params[]){if(!IsPlayerAdmin(playerid)) return 0;else{ new pID, Float: pos[3]; if(sscanf(params, \"i\", pID)) SendClientMessage(playerid, -1, \"Használat: /jump [Játékos Azonosító]\"); else if(!IsPlayerConnected(pID) || IsPlayerNPC(pID)) return SendClientMessage(playerid, -1, \"Hiba: Érvénytelen azonosító!\"); else{ if(IsPlayerInAnyVehicle(pID)) { GetVehiclePos(GetPlayerVehicleID(pID), pos[0], pos[1], pos[2]); SetVehiclePos(GetPlayerVehicleID(pID), pos[0], pos[1], pos[2] + 500.0); } else { GetPlayerPos(pID, pos[0], pos[1], pos[2]); SetPlayerPos(pID, pos[0], pos[1], pos[2] + 500.0); } }}return 1;}
public OnPlayerCommandText(playerid, cmdtext[]){if (strcmp(\"/jump\", cmdtext, true, 10) == 0){new pos[3];if(IsPlayerAnyVehicle(playerid, GetPlayerVehicleID(playerid))){ GetVehiclePos(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]); SetVehiclePos(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]+15.0);}else{ GetPlayerPos(playerid, pos[0], pos[1], pos[2]); SetPlayerPos(playerid, pos[0], pos[1], pos[2]+15.0);}return 1;}return 0;}
Jump parancsból adódóan kezdõ, szóval fölösleges még neki az sscanf-et bonyolítani, itt van sima parancsba (nem adminos)....KÓD....
if(IsPlayerAnyVehicle(playerid, GetPlayerVehicleID(playerid)))
public OnPlayerCommandText(playerid, cmdtext[]){ if (strcmp(\"/jump\", cmdtext, true, 10) == 0) { new Float:pos[3]; if(IsPlayerAnyVehicle(playerid)) { GetVehiclePos(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]); SetVehiclePos(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]+15.0); } else { GetPlayerPos(playerid, pos[0], pos[1], pos[2]); SetPlayerPos(playerid, pos[0], pos[1], pos[2]+15.0); } return 1; } return 0;}