12.02.2011, 00:51
#include <a_samp>
#define KEY_AIM 128
forward UnfreezePlayer(playerid);
forward PlayerToPoint(Float:radi, playerid, Float, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Floatldposx, Floatldposy, Floatldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PlayerToPoint(8.3,playerid,385.3112,2537.0469,1 6.5391) || PlayerToPoint(12.3,playerid,53.8419,1167.5306,18.6 641) || PlayerToPoint(8.3,playerid,1986.5774,2081.2998,10. 8203) || PlayerToPoint(10.7,playerid,-1977.3007,482.3767,29.0156) ||PlayerToPoint(10.7,playerid,-1979.3469,455.7734,28.3492)||PlayerToPoint(23.3,pl ayerid,1240.2174,-1659.8182,11.8013) || PlayerToPoint(15.3,playerid,2191.5986,1678.1766,12 .0851)|| PlayerToPoint(22.3,playerid,-2086.7954,405.6536,92.1421))
if( (newkeys & KEY_FIRE) || ( (newkeys & KEY_AIM) && (oldkeys & KEY_AIM) && (newkeys & KEY_SECONDARY_ATTACK) ) )
{
SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Don't fight in Safe Zones!");
TogglePlayerControllable(playerid, false);
SetTimerEx("UnfreezePlayer", 3000, false, "i", playerid);
return 1;
}
return 1;
}
public UnfreezePlayer(playerid)
return TogglePlayerControllable(playerid, true);
I get this error C:\Users\Desktop\Server\gamemodes\Testgm.pwn(6239) : error 021: symbol already defined: "PlayerToPoint"
i have another playertopoint in the gm any way i can fix this error
#define KEY_AIM 128
forward UnfreezePlayer(playerid);
forward PlayerToPoint(Float:radi, playerid, Float, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Floatldposx, Floatldposy, Floatldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PlayerToPoint(8.3,playerid,385.3112,2537.0469,1 6.5391) || PlayerToPoint(12.3,playerid,53.8419,1167.5306,18.6 641) || PlayerToPoint(8.3,playerid,1986.5774,2081.2998,10. 8203) || PlayerToPoint(10.7,playerid,-1977.3007,482.3767,29.0156) ||PlayerToPoint(10.7,playerid,-1979.3469,455.7734,28.3492)||PlayerToPoint(23.3,pl ayerid,1240.2174,-1659.8182,11.8013) || PlayerToPoint(15.3,playerid,2191.5986,1678.1766,12 .0851)|| PlayerToPoint(22.3,playerid,-2086.7954,405.6536,92.1421))
if( (newkeys & KEY_FIRE) || ( (newkeys & KEY_AIM) && (oldkeys & KEY_AIM) && (newkeys & KEY_SECONDARY_ATTACK) ) )
{
SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Don't fight in Safe Zones!");
TogglePlayerControllable(playerid, false);
SetTimerEx("UnfreezePlayer", 3000, false, "i", playerid);
return 1;
}
return 1;
}
public UnfreezePlayer(playerid)
return TogglePlayerControllable(playerid, true);
I get this error C:\Users\Desktop\Server\gamemodes\Testgm.pwn(6239) : error 021: symbol already defined: "PlayerToPoint"
i have another playertopoint in the gm any way i can fix this error