20.01.2010, 12:15
How would i do this, Id like to know the correct way if you could tell me please,
Heres what ive done to give you a basic example
So anyone know?
Heres what ive done to give you a basic example
pawn Код:
dcmd_pick(playerid, params[])
{
if (strlen(params))
{
id = strval(params);
if (IsPlayerConnected(id))
{
if(gTeam[playerid] == TEAM_CROOKSF)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(id, x, y, z);
if(id == playerid)
{
if(gTeam[id] != gTeam[playerid])
{
if(GetPlayerPos(playerid) >= x, y, z)
{
SetTimerEx("PickTimer", 2000, 0, "i", playerid);
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "You are pickpocketing %s, Please wait 2 seconds", name);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not a Crook");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You cannot use this command on yourself");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You cannot pickpocket a fellow crook");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to stand next to the player for 2 seconds");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Player not Found");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Usage: /pick [Playerid/PartOfName]");
}
return 1;
}
pawn Код:
public PickTimer(playerid)
{
if(GetPlayerPos(playerid) >= x, y, z)
{
GivePlayerMoney(playerid,100);
SendClientMessage(playerid, COLOR_WHITE, "You have pickpocketed this player");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not next to the player you are trying to pickpocket");
}
}

