SA-MP Forums Archive
pickup... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: pickup... (/showthread.php?tid=84167)



pickup... - lakierka - 29.06.2009

Код:
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.


Re: pickup... - ledzep - 29.06.2009


Код:
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.


Re: pickup... - gytisx - 29.06.2009


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;
    }



Re: pickup... - lakierka - 29.06.2009

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.


Re: pickup... - Nero_3D - 29.06.2009

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)


Re: pickup... - dice7 - 29.06.2009

Have you preloaded the correct anim library ?


Re: pickup... - ledzep - 29.06.2009

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


Re: pickup... - lakierka - 29.06.2009

Код:
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


Re: pickup... - dice7 - 29.06.2009

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");



Re: pickup... - lakierka - 29.06.2009

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.