SA-MP Forums Archive
mmb button - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mmb button (/showthread.php?tid=413509)



mmb button - sscarface - 05.02.2013

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == KEY_LOOK_BEHIND)
    {
    
cmd_ar(playerid, (GetClosestPlayerID);
    return 
1;
    } 
pls fix it


Re: mmb button - SilverKiller - 05.02.2013

Fix what? Does it compile? Does it work? Does it fail? If it doesn't work WHERE are the errors


Re: mmb button - sscarface - 05.02.2013

(1795 : error 076: syntax error in the expression, or invalid function call
(1795 : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


Re: mmb button - Faisal_khan - 05.02.2013

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_LOOK_BEHIND)
    {
        cmd_ar(playerid,(GetClosestPlayerID));
    }
    return 1;
}



Re: mmb button - sscarface - 05.02.2013

PHP код:
CMD:ar(playeridparams[])
{
    new 
rangepass 0vehiclepass 0wantedpass 0dutypass 0eventpass 0arrestpass 0;
    if(
GetTeam{playerid} == CLASS_CIV || GetTeam{playerid} == CLASS_MEDIC) return SendClientMessage(playeridRED"Only law enforcement can arrest players.");
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridRED"You cant arrest players from a vehicle.");
    foreach(
Playeri)
    {
        if(
== playerid) continue;
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(ixyz);
        new 
Float:hp;
        
GetPlayerHealth(ihp);
        if(
hp 0.0)
        if(
IsPlayerInRangeOfPoint(playerid8.0xyz) && GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
        {
             
rangepass++;
            if(
GetPlayerWantedLevel(i) >= 4)
            {
                
wantedpass++;
                if(!
IsPlayerInAnyVehicle(i))
                {
                    
vehiclepass++;
                    if(
IsOnduty{i} == 0)
                    {
                        
dutypass++;
                        if(
IsAtEvent{i} == 0)
                        {
                            
eventpass++;
                            if(
HasBeenArrested{i} == false)
                            {
                                
arrestpass++;
                                if(
GetTeam{playerid} == CLASS_COPS)
                                {
                                    
PlayerInfo[i][pArrests] ++;
                                    
TogglePlayerControllable(ifalse);
                                    
GameTextForPlayer(i"~r~Arrested!"30005);
                                    
format(fstrsizeof(fstr), "Officer %s (%d) has just arrested you."GetName(playerid), playerid);
                                    
SendClientMessage(iCOLOR_AQUAfstr);
                                    
GameTextForPlayer(playerid,"~w~Suspect ~g~Arrested.",5000,5);
                                    
SetPlayerScore(playeridGetPlayerScore(playerid) + 1);
                                    new 
pay random(10000) + 5000;
                                    
GivePlayerCash(playeridpay);
                                    
PlayerInfo[playerid][pTakedowns] ++;
                                    
ApplyAnimation(playerid"ped""ARRESTgun"4.101111);
                                    
format(fstr2sizeof(fstr2), "%s (%d) has been arrested by Officer %s (%d)"GetName(i), iGetName(playerid), playerid);
                                    
SendClientMessageToAll(COLOR_AQUAfstr2);
                                    
SetPlayerScore(iGetPlayerScore(i) - 1);
                                    
SetPlayerSpecialAction(iSPECIAL_ACTION_HANDSUP);
                                    
SetTimerEx("SendPlayerToJail"3000false"d"i);
                                    
HasBeenArrested{i} = true
there is my arrest cmd and fasil i got 9 errors


Re: mmb button - Faisal_khan - 05.02.2013

Post the errors and paste the whole ar command.


Re: mmb button - sscarface - 05.02.2013

bump? dont know no one?


Re: mmb button - sscarface - 05.02.2013

(1795 : error 076: syntax error in the expression, or invalid function call
(17985) : error 010: invalid function or declaration

PHP код:
 17958:  cmd_ar(playerid,(GetClosestPlayerID)); 



Re: mmb button - Faisal_khan - 05.02.2013

Alright, paste the ar command. The whole command.


Re: mmb button - Vince - 05.02.2013

pawn Код:
cmd_ar(playerid,(GetClosestPlayerID));
Closest to whom? Isn't it obvious that there is missing a parameter?