19.07.2011, 04:47
pawn Code:
#if !defined isnull
#define isnull(%1) \
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
dcmd_goto(playerid, params[])
{
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"You need to be level 2 to use this command!");
if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /Goto < Player ID >");
new
pID = strval(params),
Float: iPos[3];
GetPlayerPos(pID, iPos[0], iPos[1], iPos[2]);
SetPlayerPos(playerid, iPos[0], iPos[1], iPos[2] + 3);
new
iStr[50],
pIDN[24];
GetPlayerName(pID, pIDN, sizeof(pIDN));
format(iStr, sizeof(iStr), "You've teleported to: %s", pIDN);
return SendClientMessage(playerid, -1, iStr);
}
dcmd_gethere(playerid, params[])
{
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"You need to be level 2 to use this command!");
if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /Gethere < Player ID >");
new
pID = strval(params),
Float: iPos[3];
GetPlayerPos(playerid, iPos[0], iPos[1], iPos[2]);
SetPlayerPos(pID, iPos[0], iPos[1], iPos[2] + 3);
new
iStr[50],
pIDN[24];
GetPlayerName(pID, pIDN, sizeof(pIDN));
format(iStr, sizeof(iStr), "You've teleported: %s to you", pIDN);
return SendClientMessage(playerid, -1, iStr);
}