pickup...
#1

Код:
if(strcmp(cmdtext, "/pickup", true)==0)
	{
		new name[MAX_PLAYER_NAME];
		new id = GetPlayeridMid(name);
		if(playerDB[id][cuffed])
		SendClientMessage(playerid,zalia, "You're cuffed, can't do actions");
		return 1;
		SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP); //3071 line
		return 1;
	}
Код:
(3071) : warning 225: unreachable code
How can I fix it? When I type it in my server it's sends me message unknow command.
Reply
#2


Код:
if(strcmp(cmdtext, "/pickup", true)==0)
{
	new name[MAX_PLAYER_NAME];
	new id = GetPlayeridMid(name);
	if(playerDB[id][cuffed])
	{
		SendClientMessage(playerid,zalia, "You're cuffed, can't do actions");
		return 1;
	}
	SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP); //3071 line
	return 1;
}
That should do it.
Reply
#3


Maybe...

i
Код:
f(strcmp(cmdtext, "/pickup", true)==0)
	{
		new name[MAX_PLAYER_NAME];
		new id = GetPlayeridMid(name);
		if(playerDB[id][cuffed])
		SendClientMessage(playerid,zalia, "You're cuffed, can't do actions");
		SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP); //3071 line
		return 1;
    }
Reply
#4

Quote:
Originally Posted by ledzep
Код:
if(strcmp(cmdtext, "/pickup", true)==0)
{
	new name[MAX_PLAYER_NAME];
	new id = GetPlayeridMid(name);
	if(playerDB[id][cuffed])
	{
		SendClientMessage(playerid,zalia, "You're cuffed, can't do actions");
		return 1;
	}
	SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP); //3071 line
	return 1;
}
That should do it.
No warning, but server sends me message unknow command still.
Reply
#5

Quote:
Originally Posted by lakierka
No warning, but server sends me message unknow command still.
Two possible reasons,
1. The code crash
2. You didnt compiled (or the amx wasnt overwritten)
Reply
#6

Have you preloaded the correct anim library ?
Reply
#7

Post your entire code, or at least the OnPlayerCommandText part.
Reply
#8

Код:
f(!strcmp(cmdtext, "/cuff", true,4))
	{
 		if(playerDB[playerid][specialybe]!=1){SendClientMessage(playerid,sviesiaigeltona,"* This command only for cops"); return 1;}
 		if(cmdtext[4]==0){SendClientMessage(playerid,melyna,"* cuff player /cuff [partofname]"); return 1;}
 		new vardas[MAX_PLAYER_NAME];
 		strmid(vardas,cmdtext[5],0,MAX_PLAYER_NAME);
  	new id = GetPlayeridMid(vardas);
		if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, melyna, "* Wrong name."); return 1;}
		if (id == playerid){ SendClientMessage(playerid, melyna, "* You can't cuff yourself"); return 1;}
		new Float:Coo[3];
		GetPlayerPos(id,Coo[0],Coo[1],Coo[2]);
		if(!PlayerToPoint(3, playerid, Coo[0],Coo[1],Coo[2])){SendClientMessage(playerid, melyna, "* Player too far."); return 1;}
		
		new msg[128],police[MAX_PLAYER_NAME];
		GetPlayerName(playerid,police,sizeof(police));
		GetPlayerName(id,vardas,sizeof(vardas));
		
		if(playerDB[id][cuffed])
		{
		  playerDB[id][cuffed]=false;
		  TogglePlayerControllable(id,false);
		  
		  format(msg,sizeof(msg),"cuffed %s.",vardas);
			SendClientMessage(playerid,melyna,msg);
			
			format(msg,sizeof(msg)," you've been cuffed by %s .",police);
			SendClientMessage(id,melyna,msg);
		  
		}else{
		  playerDB[id][cuffed]=true;
		  TogglePlayerControllable(id,true);

		  format(msg,sizeof(msg),"Uncuff %s.",vardas);
			SendClientMessage(playerid,melyna,msg);

			format(msg,sizeof(msg),"you'v been uncuffed by %s.",police);
			SendClientMessage(id,melyna,msg);
		
		}
  		return 1;
 	}
Код:
if(strcmp(cmdtext, "/pickup", true)==0)
	{
	new vardas[MAX_PLAYER_NAME];
	new id = GetPlayeridMid(vardas);
	if(playerDB[id][cuffed])
	{
		SendClientMessage(playerid,zalia, "You're cuffed");
		return 1;
	}
	SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP); 
	return 1;
	}
Sorry for sintacs error, i've tried to translate to english
Reply
#9

Paste this under OnPlayerConnect
pawn Код:
PreloadAnimLib(playerid,"BOMBER");
    PreloadAnimLib(playerid,"RAPPING");
    PreloadAnimLib(playerid,"SHOP");
    PreloadAnimLib(playerid,"BEACH");
    PreloadAnimLib(playerid,"SMOKING");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"ON_LOOKERS");
    PreloadAnimLib(playerid,"DEALER");
    PreloadAnimLib(playerid,"CRACK");
    PreloadAnimLib(playerid,"CARRY");
    PreloadAnimLib(playerid,"COP_AMBIENT");
    PreloadAnimLib(playerid,"PARK");
    PreloadAnimLib(playerid,"INT_HOUSE");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"PED");
Reply
#10

Quote:
Originally Posted by dice7
Paste this under OnPlayerConnect
pawn Код:
PreloadAnimLib(playerid,"BOMBER");
    PreloadAnimLib(playerid,"RAPPING");
    PreloadAnimLib(playerid,"SHOP");
    PreloadAnimLib(playerid,"BEACH");
    PreloadAnimLib(playerid,"SMOKING");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"ON_LOOKERS");
    PreloadAnimLib(playerid,"DEALER");
    PreloadAnimLib(playerid,"CRACK");
    PreloadAnimLib(playerid,"CARRY");
    PreloadAnimLib(playerid,"COP_AMBIENT");
    PreloadAnimLib(playerid,"PARK");
    PreloadAnimLib(playerid,"INT_HOUSE");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"PED");
I have this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)