PLease help with this errors.
#1

Code:
PHP код:
dcmd_arrest(playerid,params[])
{
    new 
randomspawn random(6);
    new 
string[128];
    new 
ID;
    if(
sscanf(params"u"ID))
    {
        
SendClientMessage(playerid,COLOR_ERROR,"Use: /arrest (Player Name/ID)");
        return 
1;
    }
    if(
IsSpawned[playerid] != 1)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
        return 
1;
    }
    if(
gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA && gTeam[playerid] != TEAM_FBI)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"Only law enforcement can arrest wanted suspects.");
        return 
1;
    }
    if(!
IsPlayerConnected(ID))
    {
        
format(string,sizeof(string),"Player is not connected. You cannot arrest him.",ID);
        
SendClientMessage(playerid,COLOR_ERROR,string);
        return 
1;
    }
      if(
GetDistanceBetweenPlayers(playerid,ID) > 4)
    {
        
format(string,sizeof(string),"%s (%d) is too far away. You cannot reach him to arrest him.",PlayerName(ID),ID);
        
SendClientMessage(playerid,COLOR_ERROR,string);
        return 
1;
    }
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect while you are in a vehicle. Exit the vehicle first.");
        return 
1;
    }
    if(
GetPlayerState(ID) == PLAYER_STATE_DRIVER || GetPlayerState(ID) == PLAYER_STATE_PASSENGER)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect while he is in a vehicle.");
        return 
1;
    }
    if(
playerid == ID)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest yourself.");
        return 
1;
    }
     if(
IsSpawned[ID] != 1)
    {
        
format(string,sizeof(string),"%s (%d) is not spawned.",PlayerName(ID),ID);
        
SendClientMessage(playerid,COLOR_ERROR,string);
        return 
1;
    }
    if(
GetPlayerWantedLevel(ID) < 4)
    {
        
format(string,sizeof(string),"%s (%d)'s wanted level is too low. You cannot jail him. Use /ticket (Player ID).",PlayerName(ID),ID);
        
SendClientMessage(playerid,COLOR_ERROR,string);
        return 
1;
    }
    if(
GetDistanceBetweenPlayers(playerid,ID) <= 4)
    {
        
format(string,sizeof(string),"You have been arrested by %s (%d)",PlayerName(playerid),playerid);
        
SendClientMessage(ID,COLOR_LIGHTBLUE,string);
        
//Give the Police Officer Reward
        
IncreasePlayerScore(playerid,2);
        
//Show the jail TextDraw for suspect
        
TextDrawShowForPlayer(ID,JailTimer[ID]);
        
//Others
        
ResetPlayerWeapons(ID);
        
//Send the suspect to jail
        
if(GetPlayerWantedLevel(ID) == 4)
        {
            
format(string,sizeof(string),"%s (%d) has been arrested by %s (%d)",PlayerName(ID),ID,PlayerName(playerid),playerid);
            
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
            
//Give the police officer reward
            
format(string,sizeof(string),"You have recieved $1000 for arresting %s (%d).",PlayerName(ID),ID);
            
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            
GivePlayerMoney(playerid,1000);
            
JailTime[ID] =60;
            
TotalJailTime[ID] =60;
            if(
CITY_LOS_SANTOS == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,6);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid264.29998779297821000.5);
                    case 
1SetPlayerPos(playerid264.2999877929777.51000.5);
                    case 
2SetPlayerPos(playerid264.2999877929786.5999984741211000.5);
                }
            }
            else if(
CITY_SAN_FIERRO == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,10);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid223.30000305176108.40000152588998.40002441406);
                    case 
1SetPlayerPos(playerid219.30000305176108.40000152588998.40002441406);
                    case 
2SetPlayerPos(playerid215.30000305176108.40000152588998.40002441406);
                    case 
3SetPlayerPos(playerid227.39999389648108.30000305176998.40002441406);
                }
            }
            else if(
CITY_LAS_VENTURAS == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,3);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid194.19999694824162.100006103521002.4000244141);
                    case 
1SetPlayerPos(playerid189.89999389648162.100006103521002.4000244141);
                    case 
2SetPlayerPos(playerid198.399993896481621002.4000244141);
                    case 
3SetPlayerPos(playerid193.39999389648174.699996948241002.4000244141);
                    case 
4SetPlayerPos(playerid189174.800003051761002.4000244141);
                    case 
5SetPlayerPos(playerid197.69999694824174.699996948241002.4000244141);
                }
            }
            
TogglePlayerControllable(ID,1);
            
SetPlayerWantedLevel(ID,0);
            
SetPlayerToTeamColour(ID);
            return 
1;
        }
        if(
GetPlayerWantedLevel(ID) == 5)
        {
            
format(string,sizeof(string),"%s (%d) has been arrested by %s (%d)",PlayerName(ID),ID,PlayerName(playerid),playerid);
            
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
            
//Give the police officer reward
            
format(string,sizeof(string),"You have recieved $3000 for arresting %s (%d).",PlayerName(ID),ID);
            
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            
GivePlayerMoney(playerid,3000);
            
JailTime[ID] =180;
            
TotalJailTime[ID] =180;
            if(
CITY_LOS_SANTOS == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,6);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid264.29998779297821000.5);
                    case 
1SetPlayerPos(playerid264.2999877929777.51000.5);
                    case 
2SetPlayerPos(playerid264.2999877929786.5999984741211000.5);
                }
            }
            else if(
CITY_SAN_FIERRO == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,10);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid223.30000305176108.40000152588998.40002441406);
                    case 
1SetPlayerPos(playerid219.30000305176108.40000152588998.40002441406);
                    case 
2SetPlayerPos(playerid215.30000305176108.40000152588998.40002441406);
                    case 
3SetPlayerPos(playerid227.39999389648108.30000305176998.40002441406);
                }
            }
            else if(
CITY_LAS_VENTURAS == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,3);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid194.19999694824162.100006103521002.4000244141);
                    case 
1SetPlayerPos(playerid189.89999389648162.100006103521002.4000244141);
                    case 
2SetPlayerPos(playerid198.399993896481621002.4000244141);
                    case 
3SetPlayerPos(playerid193.39999389648174.699996948241002.4000244141);
                    case 
4SetPlayerPos(playerid189174.800003051761002.4000244141);
                    case 
5SetPlayerPos(playerid197.69999694824174.699996948241002.4000244141);
                }
            }
            
TogglePlayerControllable(ID,1);
            
SetPlayerWantedLevel(ID,0);
            
SetPlayerToTeamColour(ID);
            return 
1;
        }
        if(
GetPlayerWantedLevel(ID) == 6)
        {
            
format(string,sizeof(string),"%s (%d) has been arrested by %s (%d)",PlayerName(ID),ID,PlayerName(playerid),playerid);
            
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
            
//Give the police officer reward
            
format(string,sizeof(string),"You have recieved $5000 for arresting %s (%d).",PlayerName(ID),ID);
            
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            
GivePlayerMoney(playerid,5000);
            
JailTime[ID] =240;
            
TotalJailTime[ID] =240;
            if(
CITY_LOS_SANTOS == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,6);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid264.29998779297821000.5);
                    case 
1SetPlayerPos(playerid264.2999877929777.51000.5);
                    case 
2SetPlayerPos(playerid264.2999877929786.5999984741211000.5);
                }
            }
            else if(
CITY_SAN_FIERRO == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,10);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid223.30000305176108.40000152588998.40002441406);
                    case 
1SetPlayerPos(playerid219.30000305176108.40000152588998.40002441406);
                    case 
2SetPlayerPos(playerid215.30000305176108.40000152588998.40002441406);
                    case 
3SetPlayerPos(playerid227.39999389648108.30000305176998.40002441406);
                }
            }
            else if(
CITY_LAS_VENTURAS == gPlayerCitySelection[playerid])
            {
                
SetPlayerInterior(ID,3);
                switch(
randomspawn)
                {
                    case 
0SetPlayerPos(playerid194.19999694824162.100006103521002.4000244141);
                    case 
1SetPlayerPos(playerid189.89999389648162.100006103521002.4000244141);
                    case 
2SetPlayerPos(playerid198.399993896481621002.4000244141);
                    case 
3SetPlayerPos(playerid193.39999389648174.699996948241002.4000244141);
                    case 
4SetPlayerPos(playerid189174.800003051761002.4000244141);
                    case 
5SetPlayerPos(playerid197.69999694824174.699996948241002.4000244141);
                }
            }
            
TogglePlayerControllable(ID,1);
            
SetPlayerWantedLevel(ID,0);
            
SetPlayerToTeamColour(ID);
            return 
1;
        }
        return 
1;
    }
    return 
1;

Error:
PHP код:
(2026) : error 012invalid function callnot a valid address
(2026) : warning 215expression has no effect
(2026) : error 001expected token";"but found ")"
(2026) : error 029invalid expressionassumed zero
(2026) : fatal error 107too many error messages on one line 
Line 2026:
PHP код:
format(string,sizeof(string),"%s (%d) is too far away. You cannot reach him to arrest him.",PlayerName(ID),ID); 
Reply


Messages In This Thread
PLease help with this errors. - by [DC] - 30.01.2012, 13:13
Re: PLease help with this errors. - by niels44 - 30.01.2012, 13:57
Re: PLease help with this errors. - by Konstantinos - 30.01.2012, 14:07
Re: PLease help with this errors. - by niels44 - 30.01.2012, 14:09
Re: PLease help with this errors. - by [ABK]Antonio - 30.01.2012, 14:10
Re: PLease help with this errors. - by Roperr - 30.01.2012, 15:30
Respuesta: Re: PLease help with this errors. - by [DC] - 31.01.2012, 03:56
AW: PLease help with this errors. - by Drebin - 31.01.2012, 06:14
Respuesta: AW: PLease help with this errors. - by [DC] - 31.01.2012, 21:18
Re: PLease help with this errors. - by Unte99 - 31.01.2012, 21:55

Forum Jump:


Users browsing this thread: 3 Guest(s)