[FilterScript] BB - TP Commands
#6

Since most commands are pretty much the same, you could just do this (function created by me, although there's a similar one on SA-MP forums somewhere):
pawn Код:
stock SetPlayerPosEx(playerid,cmdname[],locname[],Float:X,Float:Y,Float:Z,int,vw,color) // cmdname = commandname, e.g. /aa, locname = place, e.g. abandoned airport, color is the color of the message that you want to be sent, rest are pretty much straightforward
{
    new string[128];
    format(string,sizeof(string),"%s has teleported to %s (%s)",PlayerName(playerid),locname,cmdname);
    SendClientMessageToAll(color,string);
    SetPlayerPos(playerid,X,Y,Z);
    SetPlayerInterior(playerid,int);
    SetPlayerVirtualWorld(playerid,vw);
    return 1;
}
It will make the script a lot shorter, instead of doing the same thing over and over again:
pawn Код:
CMD:teleport1(playerid,params[])
{
new string[128];
SetPlayerPos(playerid,X,Y,Z);
format(string,sizeof(string),"%s has teleported to TP1",PlayerName(playerid));
SendClientMessageToAll(COLOR_GREEN,string);
return 1;
}
...
Example of usage:
SetPlayerPosEx(playerid,"/blueberryfarm","Blueberry Farm",0,0,25,0,0,0x00FF00FF);
Will send the player to a farm in blueberry, and will send a green coloured message

PS Nice work for a new scripter. Good luck with future releases (if you plan any).
Reply


Messages In This Thread
BB - TP Commands - by ReD_HunTeR - 06.11.2013, 14:29
Re: BB - TP Commands - by x96664 - 06.11.2013, 15:51
Re: BB - TP Commands - by Meow22 - 06.11.2013, 16:29
Re: BB - TP Commands - by Jankingston - 06.11.2013, 17:08
Re: BB - TP Commands - by x96664 - 06.11.2013, 18:11
Re: BB - TP Commands - by bensmart469 - 06.11.2013, 19:23
Re: BB - TP Commands - by ReD_HunTeR - 07.11.2013, 13:36
Re: BB - TP Commands - by x96664 - 07.11.2013, 16:05
Re: BB - TP Commands - by ReD_HunTeR - 08.11.2013, 15:21
Re: BB - TP Commands - by x96664 - 08.11.2013, 17:58

Forum Jump:


Users browsing this thread: 6 Guest(s)