[Tool/Web/Other] Some simple zcmd commands for those who in need.
#1

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!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)