How to add the new cuff?
#1

How to add the new cuffs? This is my cuff system.

Код:
command(cuff, playerid, params[])
{
	new ID; new pname[24]; new opname[24]; new string[200];
	if(gTeam[playerid] ==Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Terror || gTeam[playerid] == Team_Steal || gTeam[playerid] == Team_PrvtMed) return SendClientMessage(playerid, COLOR_ERROR, "Only Cops/Army can use this command");
	if(GetPVarInt(playerid, "Spawned") == 0) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command.");
	if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in a vehicle.");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /cuff (ID)");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID.");
	GetPlayerName(ID, opname, 24); GetPlayerName(playerid, pname, 24);
	if(GetDistanceBetweenPlayers(playerid, ID) > 3) return SendClientMessage(playerid, COLOR_ERROR, "That player is too far away to hand cuff.");
	if(GetPVarInt(ID, "Cuffed") == 1) return SendClientMessage(playerid, COLOR_ERROR, "That player is already cuffed.");
	if(GetPVarInt(ID, "Jailed") == 1) return SendClientMessage(playerid, COLOR_ERROR, "You cannot cuff a prisoner.");
	if(IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, COLOR_ERROR, "That player is in a vehicle. You cannot cuff him.");
	if(gTeam[ID] == Team_Cop || gTeam[ID] == Team_Army || gTeam[ID] == Team_FBI) return SendClientMessage(playerid, COLOR_ERROR, "You cannot cuff other Police Officers.");
	TogglePlayerControllable(ID, 0);
	GameTextForPlayer(ID, "~b~HANDCUFFED!", 5000, 1);
	format(string, sizeof(string), "[POLICE] Officer %s(%d) has put hand cuffs on you. You cannot move.", pname, playerid);
	SendClientMessage(ID, COLOR_DODGERBLUE, string);
	format(string, 200, "[DISPATCH] Officer %s(%d) has cuffed player %s(%d)", pname, playerid, opname, ID);
	SendCopMessage(string);
	SetPVarInt(ID, "Cuffed", 1);
	SetPVarInt(ID, "CuffTimer", 30);
	SendClientMessage(playerid, COLOR_DODGERBLUE, "[POLICE] You have cuffed a suspect. You have 30 seconds before they are let loose.");
	return 1;
}
cmd(uncuff, playerid, params[])
{
	new ID; new pname[24]; new opname[24]; new string[200];
	if(gTeam[playerid] == Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Terror || gTeam[playerid] == Team_Steal || gTeam[playerid] == Team_PrvtMed) return SendClientMessage(playerid, COLOR_ERROR, "Only Cops/Army can use this command.");
	if(GetPVarInt(playerid, "Spawned") == 0) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command.");
	if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in a vehicle.");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /uncuff (ID)");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID.");
	GetPlayerName(ID, opname, 24); GetPlayerName(playerid, pname, 24);
	if(GetDistanceBetweenPlayers(playerid, ID) > 3) return SendClientMessage(playerid, COLOR_ERROR, "That player is too far away to uncuff.");
	if(GetPVarInt(ID, "Cuffed") == 0) return SendClientMessage(playerid, COLOR_ERROR, "That player ID isn't cuffed.");
	if(IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, COLOR_ERROR, "That person is in a vehicle, you cannot uncuff them.");
	TogglePlayerControllable(ID, 1);
	format(string, 200, "[POLICE] %s(%d) has uncuffed you.", pname, playerid);
	SendClientMessage(ID, COLOR_DODGERBLUE, string);
	format(string, 200, "[DISPATCH] %s(%d) has uncuffed %s(%d)", pname, playerid, opname, ID);
	SendCopMessage(string);
	SetPVarInt(ID, "Cuffed", 0); SetPVarInt(ID, "CuffTimer", 0);
	return 1;
}
Reply
#2

Код:
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
Reply
#3

Where do i add it?
Reply
#4

*Sigh*

pawn Код:
command(cuff, playerid, params[])
{
    new ID; new pname[24]; new opname[24]; new string[200];
    if(gTeam[playerid] ==Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Terror || gTeam[playerid] == Team_Steal || gTeam[playerid] == Team_PrvtMed) return SendClientMessage(playerid, COLOR_ERROR, "Only Cops/Army can use this command");
    if(GetPVarInt(playerid, "Spawned") == 0) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in a vehicle.");
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /cuff (ID)");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID.");
    GetPlayerName(ID, opname, 24); GetPlayerName(playerid, pname, 24);
    if(GetDistanceBetweenPlayers(playerid, ID) > 3) return SendClientMessage(playerid, COLOR_ERROR, "That player is too far away to hand cuff.");
    if(GetPVarInt(ID, "Cuffed") == 1) return SendClientMessage(playerid, COLOR_ERROR, "That player is already cuffed.");
    if(GetPVarInt(ID, "Jailed") == 1) return SendClientMessage(playerid, COLOR_ERROR, "You cannot cuff a prisoner.");
    if(IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, COLOR_ERROR, "That player is in a vehicle. You cannot cuff him.");
    if(gTeam[ID] == Team_Cop || gTeam[ID] == Team_Army || gTeam[ID] == Team_FBI) return SendClientMessage(playerid, COLOR_ERROR, "You cannot cuff other Police Officers.");
    TogglePlayerControllable(ID, 0);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
    GameTextForPlayer(ID, "~b~HANDCUFFED!", 5000, 1);
    format(string, sizeof(string), "[POLICE] Officer %s(%d) has put hand cuffs on you. You cannot move.", pname, playerid);
    SendClientMessage(ID, COLOR_DODGERBLUE, string);
    format(string, 200, "[DISPATCH] Officer %s(%d) has cuffed player %s(%d)", pname, playerid, opname, ID);
    SendCopMessage(string);
    SetPVarInt(ID, "Cuffed", 1);
    SetPVarInt(ID, "CuffTimer", 30);
    SendClientMessage(playerid, COLOR_DODGERBLUE, "[POLICE] You have cuffed a suspect. You have 30 seconds before they are let loose.");
    return 1;
}
cmd(uncuff, playerid, params[])
{
    new ID; new pname[24]; new opname[24]; new string[200];
    if(gTeam[playerid] == Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Terror || gTeam[playerid] == Team_Steal || gTeam[playerid] == Team_PrvtMed) return SendClientMessage(playerid, COLOR_ERROR, "Only Cops/Army can use this command.");
    if(GetPVarInt(playerid, "Spawned") == 0) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in a vehicle.");
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /uncuff (ID)");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID.");
    GetPlayerName(ID, opname, 24); GetPlayerName(playerid, pname, 24);
    if(GetDistanceBetweenPlayers(playerid, ID) > 3) return SendClientMessage(playerid, COLOR_ERROR, "That player is too far away to uncuff.");
    if(GetPVarInt(ID, "Cuffed") == 0) return SendClientMessage(playerid, COLOR_ERROR, "That player ID isn't cuffed.");
    if(IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, COLOR_ERROR, "That person is in a vehicle, you cannot uncuff them.");
    TogglePlayerControllable(ID, 1);
    format(string, 200, "[POLICE] %s(%d) has uncuffed you.", pname, playerid);
    SendClientMessage(ID, COLOR_DODGERBLUE, string);
    format(string, 200, "[DISPATCH] %s(%d) has uncuffed %s(%d)", pname, playerid, opname, ID);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    SendCopMessage(string);
    SetPVarInt(ID, "Cuffed", 0); SetPVarInt(ID, "CuffTimer", 0);
    return 1;
}
Reply
#5

I get these this error and warnings..

Код:
C:\Users\Sajeevan\Desktop\CnR1.1\gamemodes\1.1.pwn(1049) : warning 217: loose indentation
C:\Users\Sajeevan\Desktop\CnR1.1\gamemodes\1.1.pwn(2519) : warning 217: loose indentation
C:\Users\Sajeevan\Desktop\CnR1.1\gamemodes\1.1.pwn(2524) : warning 217: loose indentation
C:\Users\Sajeevan\Desktop\CnR1.1\gamemodes\1.1.pwn(4485) : warning 217: loose indentation
C:\Users\Sajeevan\Desktop\CnR1.1\gamemodes\1.1.pwn(4485) : error 017: undefined symbol "SPECIAL_ACTION_CUFFED"
C:\Users\Sajeevan\Desktop\CnR1.1\gamemodes\1.1.pwn(4486) : warning 217: loose indentation
C:\Users\Sajeevan\Desktop\CnR1.1\gamemodes\1.1.pwn(4512) : warning 217: loose indentation
C:\Users\Sajeevan\Desktop\CnR1.1\gamemodes\1.1.pwn(4513) : warning 217: loose indentation
Reply
#6

What version of samp u have? The cuff was added ion 0.3e so please upgrade to 0.3e.

Man you don't know how to ident!

Here I did it for you:
pawn Код:
command(cuff, playerid, params[])
{
    new ID; new pname[24]; new opname[24]; new string[200];
    if(gTeam[playerid] ==Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Terror || gTeam[playerid] == Team_Steal || gTeam[playerid] == Team_PrvtMed) return SendClientMessage(playerid, COLOR_ERROR, "Only Cops/Army can use this command");
    if(GetPVarInt(playerid, "Spawned") == 0) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in a vehicle.");
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /cuff (ID)");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID.");
    GetPlayerName(ID, opname, 24); GetPlayerName(playerid, pname, 24);
    if(GetDistanceBetweenPlayers(playerid, ID) > 3) return SendClientMessage(playerid, COLOR_ERROR, "That player is too far away to hand cuff.");
    if(GetPVarInt(ID, "Cuffed") == 1) return SendClientMessage(playerid, COLOR_ERROR, "That player is already cuffed.");
    if(GetPVarInt(ID, "Jailed") == 1) return SendClientMessage(playerid, COLOR_ERROR, "You cannot cuff a prisoner.");
    if(IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, COLOR_ERROR, "That player is in a vehicle. You cannot cuff him.");
    if(gTeam[ID] == Team_Cop || gTeam[ID] == Team_Army || gTeam[ID] == Team_FBI) return SendClientMessage(playerid, COLOR_ERROR, "You cannot cuff other Police Officers.");
    TogglePlayerControllable(ID, 0);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
    GameTextForPlayer(ID, "~b~HANDCUFFED!", 5000, 1);
    format(string, sizeof(string), "[POLICE] Officer %s(%d) has put hand cuffs on you. You cannot move.", pname, playerid);
    SendClientMessage(ID, COLOR_DODGERBLUE, string);
    format(string, 200, "[DISPATCH] Officer %s(%d) has cuffed player %s(%d)", pname, playerid, opname, ID);
    SendCopMessage(string);
    SetPVarInt(ID, "Cuffed", 1);
    SetPVarInt(ID, "CuffTimer", 30);
    SendClientMessage(playerid, COLOR_DODGERBLUE, "[POLICE] You have cuffed a suspect. You have 30 seconds before they are let loose.");
    return 1;
}


cmd(uncuff, playerid, params[])
{
    new ID; new pname[24]; new opname[24]; new string[200];
    if(gTeam[playerid] == Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Terror || gTeam[playerid] == Team_Steal || gTeam[playerid] == Team_PrvtMed) return SendClientMessage(playerid, COLOR_ERROR, "Only Cops/Army can use this command.");
    if(GetPVarInt(playerid, "Spawned") == 0) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in a vehicle.");
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /uncuff (ID)");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID.");
    GetPlayerName(ID, opname, 24); GetPlayerName(playerid, pname, 24);
    if(GetDistanceBetweenPlayers(playerid, ID) > 3) return SendClientMessage(playerid, COLOR_ERROR, "That player is too far away to uncuff.");
    if(GetPVarInt(ID, "Cuffed") == 0) return SendClientMessage(playerid, COLOR_ERROR, "That player ID isn't cuffed.");
    if(IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, COLOR_ERROR, "That person is in a vehicle, you cannot uncuff them.");
    TogglePlayerControllable(ID, 1);
    format(string, 200, "[POLICE] %s(%d) has uncuffed you.", pname, playerid);
    SendClientMessage(ID, COLOR_DODGERBLUE, string);
    format(string, 200, "[DISPATCH] %s(%d) has uncuffed %s(%d)", pname, playerid, opname, ID);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    SendCopMessage(string);
    SetPVarInt(ID, "Cuffed", 0); SetPVarInt(ID, "CuffTimer", 0);
    return 1;
}
Reply
#7

I have samp 0.3e.
Reply
#8

Lol guys, in both of your codes, you cuff the cop...
Reply
#9

Can someone help me? i added the code, and i get these warnings and erros, and i know i gotta ignore the warnings, but please tell me how to fix the error.

Код:
(1049) : warning 217: loose indentation
(2519) : warning 217: loose indentation
(2524) : warning 217: loose indentation
(4485) : error 017: undefined symbol "SPECIAL_ACTION_CUFFED
"
Reply
#10

Make sure you have opened the 0.3e Pawno not 0.3d.

And the Warning los indention is where they need to indent
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)