SA-MP Forums Archive
DCMD Errors - 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: DCMD Errors (/showthread.php?tid=152743)



DCMD Errors - jameskmonger - 05.06.2010

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 	dcmd(giveweapon, 10, cmdtext);
	return 0;
}

dcmd_giveweapon(playerid,params[]) {
	  new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index),tmp2 = strtok(params,Index),tmp3 = strtok(params,Index);
	  if(!strlen(tmp)||!strlen(tmp2)||!strlen(tmp3)||!IsNumeric(tmp3)||!(strval(tmp3) <= 0 || strval(tmp3) <= 10000)) return SendClientMessage(playerid,COLOR_RED,"Syntax Error: \"/GIVEWEAPON <NICK OR ID> <WEAPON NAME | ID> <1-10,000>\".");
		new id,id2; if(!IsNumeric(tmp)) id = ReturnPlayerID(tmp); else id = strval(tmp); if(!IsNumeric(tmp2)) id2 = ReturnWeaponID(tmp2); else id2 = strval(tmp2);
    if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID) {
    	if(id2==-1||id2==19||id2==20||id2==21||id2==0||id2==44||id2==45) return SendClientMessage(playerid,COLOR_RED,"ERROR: You have selected an invalid weapon ID.");
			new string[256],ActionName[24],WeaponName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24); GetWeaponName(id2,WeaponName,24); if(id2 == 18) WeaponName = "Molotov";
      if(id != playerid) { format(string,256,"Administrator \"%s\" has given you %d %s.",name,strval(tmp3),WeaponName); SendClientMessage(id,COLOR_YELLOW,string); format(string,256,"You have given \"%s\" %d %s.",ActionName,strval(tmp3),WeaponName); SendClientMessage(playerid,COLOR_YELLOW,string); }
			else { format(string,256,"You have given yourself %d %s.",strval(tmp3),WeaponName); SendClientMessage(playerid,COLOR_YELLOW,string); }
			return GivePlayerWeapon(id,id2,strval(tmp3));
	  } else return SendClientMessage(playerid,COLOR_RED,"ERROR: You can not give a disconnected player a weapon.");
}
I get an error on the
Код:
dcmd(giveweapon, 10, cmdtext);
(line 191)
Quote:

C:\Users\James\Desktop\SAMP\gamemodes\dm.pwn(191) : error 036: empty statement




Re: DCMD Errors - TheChaoz - 05.06.2010

did you define the DCMD properly
if might be the problem....