SA-MP Forums Archive
[Tool/Web/Other] Some simple zcmd commands for those who in need. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tool/Web/Other] Some simple zcmd commands for those who in need. (/showthread.php?tid=303125)



Some simple zcmd commands for those who in need. - ADDED NEW ONES. - PlayHard - 11.12.2011

Hello,

It's a simple post I posted to help some people adding ZCMD commands and study them well. The commands I am adding are scripted by me using zcmd and some of them uses scanff2.

Locating a player( his coords + place on radar )
pawn Код:
CMD:locate(playerid, params[])
{
    new string[128], GuyID, Float:x, Float:y, Float:z;
    new pName[MAX_PLAYER_NAME];
   
    if(sscanf(params,"i",GuyID)) return SendClientMessage(playerid, -1, "/locate [PlayerID/PlayerName]");
   
    GetPlayerPos(GuyID, x, y, z);
    GetPlayerName(GuyID, pName, sizeof(pName));
   
    //SetPlayerCheckpoint(playerid, x,y,z,15); //Put this if you have DisablePlayerCheckpoint!
    SetPlayerMarkerForPlayer(playerid, GuyID, 0xFF0000FF );
    format(string, sizeof(string),"%s location is: %f, %f, %f.",pName, x, y, z);
    SendClientMessage(playerid, -1, string);
    return 1;
}
Heal yourself
pawn Код:
CMD:healmyself(playerid, params[])
{
SetPlayerHealth(playerid, 100);
return 1;
}
Armour up yourself
pawn Код:
CMD:armourmyself(playerid, params[])
{
SetPlayerArmour(playerid, 100);
return 1;
}
============================December, 12 2011===============================

Giving a player money
pawn Код:
CMD:givemoney(playerid, params[])
{
    new targetid, money;
    if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid,-1,"That player is not connected.");
    if(sscanf(params, "ui", targetid, money)) return SendClientMessage(playerid,-1,"Usage: /givemoney [PlayerID/Name] [Amount]);
    GivePlayerMoney(targetid, money);
    return 1;
}
Teleport to a player
pawn Код:
CMD:goto(playerid, params[])
{
    new targetid, string[128];
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/goto [PlayerID/Name]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "The player isn't connected");
    else
    {
        new pName[24];
        GetPlayerName(targetid,pName,128);
        format(string, sizeof(string), "You succesfully teleported to [%d], mister %s :P.",targetid, pName);
        SendClientMessage(playerid,-1,string);
        SetPlayerInterior(playerid,GetPlayerInterior(targetid));
        new Float:TeleX, Float:TeleY, Float:TeleZ;
        GetPlayerPos(targetid, TeleX, TeleY, TeleZ);
        SetPlayerPos(playerid, TeleX, TeleY, TeleZ+1);
    }
    return 1;
}
Give yourself some weapons
pawn Код:
CMD:weapons(playerid, params[])
{
GivePlayerWeapon(playerid, 24, 100); //Gives a player one deagle with the ammo of 100!
GivePlayerWeapon(playerid, 31, 100); //Gives a player one M4 with the ammo of 100!
return 1;
}
Change your skin
pawn Код:
CMD:skinupmyself(playerid,params[])
{
    new skin;
    if(sscanf(params,"d",skin)) return SendClientMessage(playerid,-1,"/skinupmyself [SKINID]");
    else if(skin > 299 || skin < 1) return SendClientMessage(playerid, -1, "[Error Occured]: The skin you're trying to use is not available");
    else
    {
        SetPlayerSkin(playerid,skin);
    }
    return 1;
}
Naming on/off your "Name Tag" that takes a place on every player's head in-game.
pawn Код:
CMD:nameon(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, true);
    GameTextForPlayer(playerid, "~W~Nametags ~g~On", 5000, 5);
    return 1;
}

CMD:nameoff(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
    GameTextForPlayer(playerid, "~W~Nametags ~R~OFF", 5000, 5);
    return 1;
}
Repair your vehicle.
pawn Код:
CMD:fixmyride(playerid, params[])
{
    if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "[Error Occured]: You aren't in a vehicle, you can't repair yourself :P.");
    RepairVehicle(GetPlayerVehicleID(playerid));
    SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
    return SendClientMessage(playerid, COLOR_GREY, "[Info]: {FFFFFF}The vehicle has been successfully repaired!");
    return 0;
}
Add (10x) Nitrous to your vehicle
pawn Код:
CMD:10nitrous(playerid, params[])
{
    if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
    {
        new veh;
        veh = GetPlayerVehicleID(playerid);
        SendClientMessage(playerid, -1, "You've successfully installed (10x) Nitrous bottles into the vehicle.");
        return AddVehicleComponent(veh, 1010);
    }
    else
    {
        return SendClientMessage(playerid, -1, "[Error Occured]: You aren't in a vehicle.");
    }
    return 0;
}
Remove all your weapons from your hand
pawn Код:
CMD:dropmyweps(playerid, params[])
{
    new pName[24];
    GetPlayerName(playerid,pName,24);
    format(string, sizeof(string),"%s has dropped all his weapons", pName);
    SendClientMessageToAll(-1,string);
    ResetPlayerWeapons(playerid);
    return 1;
}
More to come!


Re: Some simple zcmd commands for those who in need. - Epic_Mickey - 11.12.2011

Hmmm, it isnt very hard to read the instructions at the zcmd release topic


Re: Some simple zcmd commands for those who in need. - olabv - 11.12.2011

Great work. Keep it updated plz


Re: Some simple zcmd commands for those who in need. - Notis123 - 12.12.2011

Good work for layzy ass people and for those who dont know how to use it


Re: Some simple zcmd commands for those who in need. - PlayHard - 12.12.2011

UPDATED!


Re: Some simple zcmd commands for those who in need. - §с†¶e®РµРe - 13.12.2011

wtf who doesn't know about zcmd and sscanf nowadays?


Re: Some simple zcmd commands for those who in need. - PlayHard - 13.12.2011

Quote:
Originally Posted by §с†¶e®РµРe
Посмотреть сообщение
wtf who doesn't know about zcmd and sscanf nowadays?
A lot.


Re: Some simple zcmd commands for those who in need. - DreamOnIt - 13.12.2011

The intention is good but the commands you did are really easy and even a newcomer can do them xD Try some more "advanced" needed commands


Re: Some simple zcmd commands for those who in need. - Max_Coldheart - 13.12.2011

This is really bad tutorial. You haven't explained anything


Re: Some simple zcmd commands for those who in need. - AceFlyer - 14.12.2011

No Explanations About the Commands And Like Others Said These are really easy Commands.you should also put in links to the sscanf plugin and the zcmd include.