|
|
#1731 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2007
Location: Germany
Posts: 3,007
Reputation: 254
|
That wont work because its an enum, an enum doesnt create a real array inside
Lets check how the compiler sees your code pawn Code:
pawn Code:
pawn Code:
I think the best way would be to loop through the array till it finds a 0 (for no weapon) pawn Code:
|
|
|
|
|
|
#1732 | |
|
Huge Clucker
![]() ![]() ![]() Join Date: Mar 2012
Location: Norway
Posts: 221
Reputation: 112
|
Quote:
|
|
|
|
|
|
|
#1733 |
|
Big Clucker
![]() ![]() Join Date: Mar 2012
Location: Western Germany
Posts: 82
Reputation: 9
|
its quite late and im having a problem im not able to solve :/
Code:
enum d
{
b,
Float:c[3]
}
new a[2][d] = {
{1, {1.0,...} }, <--- errorline (13)
{1, {1.0,1.0,1.0} }
};<--- errorline (15)
(13) : error 029: invalid expression, assumed zero
(15) : error 010: invalid function or declaration
(16) : warning 203: symbol is never used: ""
(16) : warning 203: symbol is never used: "a"
|
|
|
|
|
|
#1734 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Mar 2012
Posts: 1,604
Reputation: 144
|
Try that..
pawn Code:
|
|
|
|
|
|
#1735 |
|
Big Clucker
![]() ![]() Join Date: Mar 2012
Location: Western Germany
Posts: 82
Reputation: 9
|
no thats not what i am looking for
|
|
|
|
|
|
#1736 |
|
Little Clucker
![]() Join Date: Jul 2010
Posts: 7
Reputation: 0
|
I can't break the animation on SPECIAL_ACTION_CUFFED
Code:
if(strcmp(cmd, "/cuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAAgent(playerid) || IsANG(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [Playerid/PartOfName]");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Cannot use this while in a Car !");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " You can't Cuff Cops !");
return 1;
}
if(IsANG(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " You can't Cuff National Guards !");
return 1;
}
if(PlayerTied[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " That player is Tied up !");
return 1;
}
if(PlayerCuffed[giveplayerid] > 1)
{
SendClientMessage(playerid, COLOR_GREY, " That player is already Cuffed !");
return 1;
}
if(IsPlayerInAnyVehicle(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Suspect is in a car, get him out first !");
return 1;
}
if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " You can't Cuff yourself !"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You were Cuffed by Officer %s.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
if(PlayerInfo[giveplayerid][pMask] == 1)
{
format(string, sizeof(string), "* You Cuffed A Stranger.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s Hand Cuffs A Stranger, so he wont go anywhere.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* You Cuffed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s Hand Cuffs %s, so he wont go anywhere.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
TogglePlayerControllable(giveplayerid, 1);
ClearAnimations(giveplayerid);
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
PlayerCuffed[giveplayerid] = 2;
PlayerCuffedTime[giveplayerid] = 86400;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player needs to be restrained first !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / SAST !");
}
}
return 1;
}
if(strcmp(cmd, "/uncuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAAgent(playerid) || IsANG(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [Playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " You can't Uncuff yourself !"); return 1; }
if(PlayerCuffed[giveplayerid])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
if(PlayerInfo[giveplayerid][pMask] == 1)
{
format(string, sizeof(string), "* You uncuffed A Stranger.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has uncuffed A Stranger.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* You uncuffed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has uncuffed %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
TogglePlayerControllable(giveplayerid, 1);
ClearAnimations(giveplayerid);
PlayerCuffed[giveplayerid] = 0;
PlayerCuffedTime[giveplayerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player isn't Cuffed !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / SAST !");
}
}
return 1;
|
|
|
|
|
|
#1737 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Mar 2012
Location: Norway
Posts: 221
Reputation: 112
|
That's because SPECIAL_ACTION_CUFFED isn't an animation in terms of the other anims. It's a special action that can only be cleared by other special actions, and in some cases, pressing ENTER/etc..
If you want to clear it script wise use: pawn Code:
|
|
|
|
|
|
#1738 |
|
Big Clucker
![]() ![]() Join Date: Nov 2011
Location: Indonesia
Posts: 139
Reputation: 19
|
Hello, I still cofused about the usage of MoveObject, the default rot is -1000 right, so if i want to rotate it 90 deg, what number i have to put?
And, if I set PVarInt in the filterscript, can it be read at the GM? |
|
|
|
|
|
#1739 | |
|
Banned
![]() Join Date: Apr 2009
Location: England
Posts: 4,011
Reputation: 701
|
Quote:
The input is in degrees so just put 90. As for PVars, yes, they can be read (and written I think) across scripts
|
|
|
|
|
|
|
#1740 |
|
Big Clucker
![]() ![]() Join Date: Dec 2010
Posts: 108
Reputation: 10
|
Should I forward every single of my functions?
I'm not really sure what it does. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to make a soldier aotumaticly be general when the general dies ? | AlbanianGuy | Scripting Help | 35 | 13/05/2012 03:35 PM |
| Minor problem | Desert | Help Archive | 4 | 17/03/2010 05:24 PM |
| Counting with mysql queries | actiwe | Help Archive | 2 | 26/02/2010 02:36 PM |
| SQL queries using GROUP BY | Dabombber | Help Archive | 2 | 05/10/2009 07:47 PM |