But i think that my gamemode is bugged, cause dont work zcmd. I show code again, I remove OnPlayerCommandText...
Code:
#include <a_samp>
#include <core>
#include <float>
#include <streamer>
#include <PreviewModelDialog>
#include <memory>
#include "../include/gl_common.inc"
#include <zcmd>
#pragma tabsize 0
CMD:monte(playerid, params[])
{
SetPlayerPos(playerid, -2228.7312,-1744.6199,480.8849);
return 1;
}
CMD:ls(playerid, params[])
{
SetPlayerPos(playerid, 1496.6437,-1674.2910,14.0469);
return 1;
}
CMD:lv(playerid, params[])
{
SetPlayerPos(playerid, 2113.5903,1900.2289,10.8203);
return 1;
}
CMD:luces(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(lights)
{
SetVehicleParamsEx(vehicleid, engine, false, alarm, doors, bonnet, boot, objective);
}
else
{
SetVehicleParamsEx(vehicleid, engine, true, alarm, doors, bonnet, boot, objective);
}
}
}
return 1;
}
CMD:neon(playerid, params[])
{
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
return SendClientMessage(playerid, -1, "");
}
new pveh = GetPlayerVehicleID(playerid);
if (!GetVehicleModel(pveh)) return SendClientMessage(playerid, -1, "");
if (VObject(obj[pveh])) return SendClientMessage(playerid, -1, ""), DObject(obj[pveh]);
switch (GetVehicleModel(pveh))
{
case 596:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.379999, 0.889999, 0.000000, 0.000000, 0.000000);
}
case 597:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.374999, 0.884999, 0.000000, 0.000000, 0.000000);
}
case 598:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, -0.334498, 0.933500, 0.000000, 0.000000, 0.000000);
}
case 599:
{
obj[pveh] = CObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AObject(obj[pveh], pveh, 0.000000, 0.039999, 1.153999, 0.000000, 0.000000, 0.000000);
}
default:
{
return SendClientMessage(playerid, -1, "");
}
}
return SendClientMessage(playerid, -1, "");
}
CMD:kill(playerid, params[])
{
SetTimerEx("ClassSelection", 10000, false, "i", playerid);
SendClientMessage(playerid, -1,"[INFO] Cambio de clase en 10 segundos");
return 1;
}
CMD:subirtranvia(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetVehiclePos(TRAMID, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
{
if(!IsVehicleSeatOccupied(TRAMID, 1)) PutPlayerInVehicle(playerid, TRAMID, 1);
if(!IsVehicleSeatOccupied(TRAMID, 2)) PutPlayerInVehicle(playerid, TRAMID, 2);
if(!IsVehicleSeatOccupied(TRAMID, 3)) PutPlayerInVehicle(playerid, TRAMID, 3);
if(!IsVehicleSeatOccupied(TRAMID, 4)) PutPlayerInVehicle(playerid, TRAMID, 4);
if(!IsVehicleSeatOccupied(TRAMID, 5)) PutPlayerInVehicle(playerid, TRAMID, 5);
SendClientMessage(playerid, 0x02b1afFF, "* Has subido al tranvнa. Para salir usa /salirtranvia.");
}
else return SendClientMessage(playerid, 0xFF6347FF, "* Demasiado lejos.");
return 1;
}
CMD:salirtranvia(playerid, params[])
{
RemovePlayerFromVehicle(playerid);
SetCameraBehindPlayer(playerid);
return 1;
}
stock IsVehicleSeatOccupied(vehicleid,seatid)
{
if(!GetVehicleModel(vehicleid)) return 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i,vehicleid) && GetPlayerVehicleSeat(i) == seatid)
{
return 1;
}
}
return 0;
}
//----------------------------------------------------------
//----------------------------------------------------------
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
return 1;
}
public OnPlayerExitVehicle(playerid,vehicleid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,0,0,alarm,doors,bonnet,boot,objective);
return 1;
}
public ClassSelection(playerid)
{
ForceClassSelection(playerid);
SetPlayerHealth(playerid, 0.0);
return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(result == -1)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command.");
return 0;
}
return 1;
}