11.12.2011, 19:51
(
Последний раз редактировалось PlayHard; 12.12.2011 в 17:44.
Причина: Update
)
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 )
Heal yourself
Armour up yourself
============================December, 12 2011===============================
Giving a player money
Teleport to a player
Give yourself some weapons
Change your skin
Naming on/off your "Name Tag" that takes a place on every player's head in-game.
Repair your vehicle.
Add (10x) Nitrous to your vehicle
Remove all your weapons from your hand
More to come!
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;
}
pawn Код:
CMD:healmyself(playerid, params[])
{
SetPlayerHealth(playerid, 100);
return 1;
}
pawn Код:
CMD:armourmyself(playerid, params[])
{
SetPlayerArmour(playerid, 100);
return 1;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}