SA-MP Forums Archive
Command problem - 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: Command problem (/showthread.php?tid=197338)



Command problem - Mehtab - 08.12.2010

when i type /mafia it tells me unknown command. I compile it perfectly.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{	
       dcmd(mafia,3,cmdtext);
	return 0;
}
Код:
dcmd_mafia(playerid,params[])
{
	#pragma unused params
	if(GetPlayerJob(playerid) != 0) return SendClientMessage(playerid,0xFFFFFFAA,"You already have a job!");
	PInfo[playerid][Job] = 1;// mafia job
	new JobID = PInfo[playerid][Job];
	pLevel[playerid][JobID] = 1;
	SendClientMessage(playerid,WHITE,"You are now a mafia!");
	return 1;
}



Re: Command problem - Mehtab - 08.12.2010

bump!!!!!!!!!!!!!!


Respuesta: Command problem - Quantum - 08.12.2010

Код:
dcmd(mafia,5,cmdtext);
5 is the number of characters of the command.