SA-MP Forums Archive
Help - 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: Help (/showthread.php?tid=536883)



Help - FisherMan - 12.09.2014

How To Make Only 1 Wanted To To 1000 Can Cuff !
And Cant Cuff 0 Wanted !


Re: Help - Sledgehammer - 12.09.2014

Could you explain your issue in further detail? I didn't quite catch what your trying to do.


Re: Help - FisherMan - 12.09.2014

Removed


Re: Help - ZombieNest - 12.09.2014

I think he says he cant cuff 0 wanted level players, He can only cuff waned levels and he want to make it to cuff anyone


Re: Help - FisherMan - 12.09.2014

Quote:
Originally Posted by ZombieNest
Посмотреть сообщение
I think he says he cant cuff 0 wanted level players, He can only cuff waned levels and he want to make it to cuff anyone
its cuff myself and cuff every one wanted no wanted
i want only make cuff with 1 wanted to player have any wanted cuffed
and cant cuff myself
Cuff Wanted only Cant Cuff No Wanted Cant Cuff MySelf


Re: Help - SHE790 - 12.09.2014

i think he means i want to /cuff the player with +1 wanted level


Re: Help - IceBilizard - 12.09.2014

pawn Код:
CMD:cuff(playerid, params[])//This is will create you cmd so you can continue your codes.
{

if (gTeam[playerid] == TEAM_SWAT || gTeam[playerid] == TEAM_COPS || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_FBI)SendClientMessage(playerid, COLOR_RED, "You Are Not A Cop. Only Cops Can Use This Command.");
{
    new targetid;//this defines the id of the player you want to cuff((playerid id your id and the target id that I defined it the id of the player you want to cuff))
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "[USAGE]: /cuff [Part of Name/Player ID]");
    if(IsPlayerConnected(targetid))//this will check that if the player you want to cuff is connected to the server or not.
    {
        new Float:x, Float:y, Float:z;//these are the defines of your x,y and z position.
        GetPlayerPos(playerid, x, y, z);//this will store your position to be used in the following codes.((this stores the your x,y, and z position in to the variables we created.))
        if(GetPlayerWanted(targetid) < 1) return SendClientMessage(playerid, -1, "That player is not wanted!");
        if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))//this will check that if the player you want to cuff is near you or not.
        {
        new str[512];//this it the define for the string you will format further.((str means string.You can also change it to string but this seems to be easy.))
        new name[MAX_PLAYER_NAME];//this is the variable you created to store the your name.
        GetPlayerName(playerid, name, sizeof(name));//this will get your name and store it in the variable you defines as name.
        new target[MAX_PLAYER_NAME];//this is the variable you created to store the name of the player you want to cuff.
        GetPlayerName(targetid, target, sizeof(target));//this will get the name of the person you want to cuff and will store it into a variable we defined as target.
        format(str, sizeof(str), "INFO: You have cuffed %s!",target);//explained at the end of the tutorial.
        SendClientMessage(playerid, 0xE01B1B, str);//this will send the formated message to you that you created before.
        format(str, sizeof(str), "WARNING: You have been cuffed by %s!",name);//explained at the end of the tutorial.
        SendClientMessage(targetid, 0xE01B1B, str);//this will send the formated message to the player you cuffed.
        SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);//this will set the object cuffs at the hand of the player you want to cuff.
        SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);//this will set players hand backwards.
        }
        return 1;
    }
}
return 1;
}



Re: Help - FisherMan - 12.09.2014

Quote:

C:\Documents and Settings\NightDay\My Documents\ffff\gamemodes\barron.pwn(455) : error 017: undefined symbol "GetPlayerWanted"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

this line error
Quote:

if(GetPlayerWanted(targetid) < 1) return SendClientMessage(playerid, COLOR_RED, "That player is not wanted!");




Re: Help - IceBilizard - 12.09.2014

sorry my mistake its

pawn Код:
GetPlayerWantedLevel
Edit: Here is the fix code
pawn Код:
CMD:cuff(playerid, params[])//This is will create you cmd so you can continue your codes.
{

if (gTeam[playerid] == TEAM_SWAT || gTeam[playerid] == TEAM_COPS || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_FBI)SendClientMessage(playerid, COLOR_RED, "You Are Not A Cop. Only Cops Can Use This Command.");
{
    new targetid;//this defines the id of the player you want to cuff((playerid id your id and the target id that I defined it the id of the player you want to cuff))
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "[USAGE]: /cuff [Part of Name/Player ID]");
    if(IsPlayerConnected(targetid))//this will check that if the player you want to cuff is connected to the server or not.
    {
        new Float:x, Float:y, Float:z;//these are the defines of your x,y and z position.
        GetPlayerPos(playerid, x, y, z);//this will store your position to be used in the following codes.((this stores the your x,y, and z position in to the variables we created.))
        if(GetPlayerWantedLevel(targetid) < 1) return SendClientMessage(playerid, -1, "That player is not wanted!");
        if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))//this will check that if the player you want to cuff is near you or not.
        {
        new str[512];//this it the define for the string you will format further.((str means string.You can also change it to string but this seems to be easy.))
        new name[MAX_PLAYER_NAME];//this is the variable you created to store the your name.
        GetPlayerName(playerid, name, sizeof(name));//this will get your name and store it in the variable you defines as name.
        new target[MAX_PLAYER_NAME];//this is the variable you created to store the name of the player you want to cuff.
        GetPlayerName(targetid, target, sizeof(target));//this will get the name of the person you want to cuff and will store it into a variable we defined as target.
        format(str, sizeof(str), "INFO: You have cuffed %s!",target);//explained at the end of the tutorial.
        SendClientMessage(playerid, 0xE01B1B, str);//this will send the formated message to you that you created before.
        format(str, sizeof(str), "WARNING: You have been cuffed by %s!",name);//explained at the end of the tutorial.
        SendClientMessage(targetid, 0xE01B1B, str);//this will send the formated message to the player you cuffed.
        SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);//this will set the object cuffs at the hand of the player you want to cuff.
        SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);//this will set players hand backwards.
        }
        return 1;
    }
}
return 1;
}



Re: Help - FisherMan - 12.09.2014

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
sorry my mistake its

pawn Код:
GetPlayerWantedLevel
PHP код:
        if(GetPlayerWanted(targetid) < 1) return SendClientMessage(playeridCOLOR_RED"That player is not wanted!"); 
to this ?
PHP код:
 if(GetPlayerWantedLevel1) return SendClientMessage(playeridCOLOR_RED"That player is not wanted!");