Possible Zcmd?
#1

Hello
I have a gamemode and its not created by Zcmd its a_samp...

So my question is "Can i use ZCMD"?
Reply
#2

Yes, but you must convert all the commands...
Reply
#3

Give me all your OnPlayerCommandText callback
Reply
#4

Here it is:
public OnPlayerCommandText(playerid, cmdtext[])
{

if(strcmp(cmdtext, "/mhill", true) == 0){
if(IsPlayerInAnyVehicle(playerid) == 1) {
SetPlayerInterior(playerid, 0);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid),-2489.6118,-615.7424,132.1036);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 310.2000);
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , 0);
} else {
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
}
} else {
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
}
return 1;
}
Reply
#5

Hello,Help me please?
Reply
#6

pawn Код:
CMD:mhill
{
if(IsPlayerInAnyVehicle(playerid) == 1) {
SetPlayerInterior(playerid, 0);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid),-2489.6118,-615.7424,132.1036);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 310.2000);
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , 0);
} else {
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
}
} else {
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
}
return 1;
}
It's easy to make commands with zcmd. For example, if you create a command (/healme) - here's the way of normal OnPlayerCommandText:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/healme", true) == 0)
{
 SetPlayerHealth(playerid, 100.00);
 return 1;
}
return 0;
}
Where as in zcmd, it gets more easier and is more efficient.

CMD:healme(playerid, params[])
{
SetPlayerHealth(playerid, 100.00);
return 1;
}
[/PAWN]



Zcmd commanding:
pawn Код:
CMD:yourcommand(playerid, params[]) //playerid refers to the player using the cmd. params refers to the string parameter of the command.
{
 //Here functions
 return 1; //Returning the command.
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)