/swat shut down the server
#1

can you help me ? when i write /swat, the server fell down...










if(PlayerInfo[playerid][Faction] == 4)
{
if(IsPlayerInRangeOfPoint(playerid,3.0,257.9324,77 .5067,1003.6406))
{
PlayerInfo[playerid][Duty]=1;
new Float: X,Float: Y,Float: Z;
GetPlayerPos(playerid,X,Y,Z);
format(string,sizeof(string),"%s takes the swat unifrom and guns from the locker and wear the unifrom.");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i,5.0,X,Y,Z))
{
SendClientMessage(i,COLOR_SEA,string);
}
}
SetPlayerSkin(playerid,285);
GivePlayerWeapon(playerid,17,50);
GivePlayerWeapon(playerid,31,500);
GivePlayerWeapon(playerid,29,500);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,39,1);
return 1;
}
else
{
return SendClientMessage(playerid,COLOR_BRIGHTRED,"[ERROR]: You are not at the locker room!");
}
Reply
#2

if(IsPlayerInRangeOfPoint(playerid,3.0,257.9324,77 .5067,1003.6406))
there is space at 77 .5067, remove that space, it might help
Reply
#3

i dont know why, but when i paste this command, i see it without the space, when i post it, there is a space, i dont know why...

Quote:

if(PlayerInfo[playerid][Faction] == 4)
{
if(IsPlayerInRangeOfPoint(playerid,3.0,257.9324,77 .5067,1003.6406))
{
PlayerInfo[playerid][Duty]=1;
new Float: X,Float: Y,Float: Z;
GetPlayerPos(playerid,X,Y,Z);
format(string,sizeof(string),"%s takes the swat unifrom and guns from the locker and wear the unifrom.");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i,5.0,X,Y,Z))
{
SendClientMessage(i,COLOR_SEA,string);
}
}
SetPlayerSkin(playerid,285);
GivePlayerWeapon(playerid,17,50);
GivePlayerWeapon(playerid,31,500);
GivePlayerWeapon(playerid,29,500);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,39,1);
return 1;
}
else
{
return SendClientMessage(playerid,COLOR_BRIGHTRED,"[ERROR]: You are not at the locker room!");
}

Reply
#4

Try this:
pawn Код:
if(PlayerInfo[playerid][Faction] == 4)
{
    if(IsPlayerInRangeOfPoint(playerid,3.0,257.9324,77 .5067,1003.6406))
    {
        PlayerInfo[playerid][Duty]=1;
        new Float: X,Float: Y,Float: Z;
        GetPlayerPos(playerid,X,Y,Z);
        new plname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,plname,sizeof(plname));
        format(string,sizeof(string),"%s takes the swat unifrom and guns from the locker and wear the unifrom.",plname);
        for(new i, m=GetMaxPlayers(); i<m; i++)
        {
            if(!IsPlayerConnected(i)) continue;
            if(IsPlayerInRangeOfPoint(i,5.0,X,Y,Z))
            SendClientMessage(i,COLOR_SEA,string);
        }
        SetPlayerSkin(playerid,285);
        GivePlayerWeapon(playerid,17,50);
        GivePlayerWeapon(playerid,31,500);
        GivePlayerWeapon(playerid,29,500);
        GivePlayerWeapon(playerid,24,500);
        GivePlayerWeapon(playerid,39,1);
        return 1;
    }
    else
    {
        return SendClientMessage(playerid,COLOR_BRIGHTRED,"[ERROR]: You are not at the locker room!");
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)