PDA

View Full Version : 0.3e Cuff Help


Craft.
11/06/2012, 09:33 PM
heres my pawn

CMD:cuff(playerid, params[])
{
if(IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2))
{
if(GetPVarInt(playerid, "Injured") == 1)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
return 1;
}

new string[128], giveplayerid;
if(sscanf(params, "d", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /cuff [playerid]");

if(IsPlayerConnected(giveplayerid))
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff yourself!"); return 1; }
if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
{
format(string, sizeof(string), "* You have been handcuffed by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You handcuffed %s, till uncuff.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s handcuffs %s, tightening the cuffs securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
ClearAnimations(giveplayerid);
SetPlayerSpecialAction(SPECIAL_ACTION_CUFFED);
PlayerCuffed[giveplayerid] = 2;
SetPVarInt(giveplayerid, "PlayerCuffed", 2);
SetPVarInt(giveplayerid, "IsFrozen", 1);
//Frozen[giveplayerid] = 1;
PlayerCuffedTime[giveplayerid] = 300;
}


It comes up with a few errors:


C:\Users\Administrator\Desktop\Uncharted Roleplay\gamemodes\URP.pwn(67558) : error 017: undefined symbol "SPECIAL_ACTION_CUFFED"
C:\Users\Administrator\Desktop\Uncharted Roleplay\gamemodes\URP.pwn(67558) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\Uncharted Roleplay\gamemodes\NGRP.pwn(67558) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Administrator\Desktop\Uncharted Roleplay\gamemodes\URP.pwn(67558) : error 017: undefined symbol "SPECIAL_ACTION_CUFFED"
C:\Users\Administrator\Desktop\Uncharted Roleplay\gamemodes\URP.pwn(67558) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

DartakousLien
11/06/2012, 09:47 PM
you need SAMP 0.3e RC3 or height
and use
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_CUF FED); not SetPlayerSpecialAction(SPECIAL_ACTION_CUFFED);

Craft.
11/06/2012, 09:55 PM
I changed it and it still doesnt work :/

DartakousLien
11/06/2012, 10:00 PM
erros ?

Craft.
11/06/2012, 10:18 PM
Non it just doesnt work ig

DartakousLien
11/06/2012, 10:22 PM
don't show any erros in pawno and don't work in your server? write a complete command please

Sanady
11/06/2012, 10:23 PM
Non it just doesnt work ig

Check the codes.. :)

Toby_Manley
11/06/2012, 10:32 PM
check the server log to see if the script loaded and make sure that the plugins are in your server.cfg

ricardo178
11/06/2012, 11:19 PM
For the fuck sake, now i don't know who is being the noober here, if him, or the ones replying... I guess the ones replying.

I am with no lights here so wont re-make the whole command but some tips on what is bad...

If you use playerid, it will do it for you and not for the player.
To define ID in sscanf or whatever you call it, use the charather "u" and not "d"...

I think i said enough..

DartakousLien
11/06/2012, 11:23 PM
no, you not said enough... i use "d" not "u" and work!

ReneG
12/06/2012, 01:32 AM
For the fuck sake, now i don't know who is being the noober here, if him, or the ones replying... I guess the ones replying.

I am with no lights here so wont re-make the whole command but some tips on what is bad...

If you use playerid, it will do it for you and not for the player.
To define ID in sscanf or whatever you call it, use the charather "u" and not "d"...

I think i said enough..
Vaguely explained, but yeah.

In sscanf, the specifier 'u' is for a username/playerid. So when typing the command, the player can also input a name instead of a playerid. Not required, but its a nice little thing to have on your mode. You can still use 'd', for an integer only.