Help Zcmd
#1

I'm using Zcmd and when I put /"command" does not work, can someone help me??

Код:
#include <a_samp>
#include <core>
#include <float>
#include "../include/gl_common.inc"
#include <streamer>
#include <PreviewModelDialog>
#include <memory>
#include <zcmd>
#include "../include/foreach.inc"
#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;
    }
Reply
#2

Is this code in your Gamemode or a Filterscript?
Reply
#3

this code is in my Gamemode, and dont work
Reply
#4

Do you have OnplayerCommandText ?
Reply
#5

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
Do you have OnplayerCommandText ?
yes, i have, but dont work, can someone link me a zcmd.inc??

Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
	// No Commands HERE
    return 0;
}
CMD:kill(playerid, params[])
{
  	SetTimerEx("ClassSelection", 10000, false, "i", playerid);
    SendClientMessage(playerid, -1,"[INFO] Cambio de clase en 10 segundos");
    return 1;
}
Reply
#6

add tihs

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], result)
{
    if(
result == -1)
    {
        
SendClientMessage(playerid0xFFFFFFFF"SERVER: Unknown command.");
        return 
0;
    }

    return 
1;

Reply
#7

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
add tihs

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], result)
{
    if(
result == -1)
    {
        
SendClientMessage(playerid0xFFFFFFFF"SERVER: Unknown command.");
        return 
0;
    }
    return 
1;

what is the way for solve this error??

Код:
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\Kon2.pwn(15570) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

You must have OnPlayerCommandPerformed already, just replace it (copy-paste)
Reply
#9

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
You must have OnPlayerCommandPerformed already, just replace it (copy-paste)
I do not have it already, still give me error.
Reply
#10

That error means there's something wrong with the include or how you are using it... Re-download it to verify you have the right one.
Reply
#11

The error simply says you have different set of parameter names as compared to the declared ones. Nothing wrong with your include.

This is from the official zcmd include:
PHP Code:
OnPlayerCommandPerformed(playeridcmdtext[], success
And you can see the difference, you have "result" but its suppose to be "success".
Reply
#12

Quote:
Originally Posted by bookknp
View Post
very thx Gammix, you are great

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;
}
Very thx guys, a fucking filescript block my zcmd... THX!!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)