forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
new playerworld, player2world;
playerworld = GetPlayerVirtualWorld(playerid);
player2world = GetPlayerVirtualWorld(i);
if(playerworld == player2world)
{
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}
return 1;
}
OnPlayerText(playerid, text[])
{
new string[150], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string),"%s: %s", pname, text);
ProxDetector(10.0 /* or 5.0, depends what you want */, playerid, string, -1, -1, -1, -1, -1);
return 0;
}
The thing is, you'll need to learn it yourself. You can find useful things on the SA-MP Wiki. I personally, never use the wiki, only to check out some parameters. I've learned PAWN by actually just experimenting with it, really. See what it does InGame when you change this, change that,... . Also I advice you to look at the tutorial section. There are numerous threads about creating an admin system.
|
If the maps Are CreateObject,
Change them to CreateDynamicObject (use Incognito's Streamer). Btw: my server was crashing for maps, and changed the CreateObject to CreateDynamicObject and it worked. |
With CreateObject the limit is a 1000 with CreateDynamicObject it is unlimited so you can use CreateDynamicObject as much as you like if you go Higher then a 100 CreateObjects all of your server maps will go away and wont bell to see it unless you change it to CreateDynamicObject but also there is other ways to higher then createobject limit not to sure how but i will find out soon!!
Using the Samp wike will help you alot i am createing my own gamemode now and i might even release it cos i like doing it for fun and learning something new every day like the others do |
If the maps Are CreateObject,
Change them to CreateDynamicObject (use Incognito's Streamer). Btw: my server was crashing for maps, and changed the CreateObject to CreateDynamicObject and it worked. |