08.02.2009, 02:10
Quote:
Originally Posted by ♦۞pкћп§-шŧųĄ۞♦
pawn Код:
|
Originally Posted by ♦۞pкћп§-шŧųĄ۞♦
pawn Код:
|
//After includes at top
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2])))))return 1
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(recruit, 7, cmdtext);
return 0;
}
//Your command goes at the bottom of your script. Nowhere else.
dcmd_recruit(playerid,params[])
{
//rest of your code.
}
new playername[24]; GetPlayerName(playerid,playername,24); new file[128]; format(file,128,"%s.txt",udb_encode(playername)); if(gTeam[playerid]==TEAM_RIFAS) { if(dini_Int(file,"Rifas") != 1) { ForceClassSelection(playerid); dini_IntSet(file,"Rifas",0); SendClientMessage(playerid,0xFFFFFFAA,"You're not an official Rifas Member!"); return 0; } else if(dini_Int(file,"Rifas") == 1) { } }
dcmd_recruit(playerid,params[]) { if(!params[0]) { SendClientMessage(playerid,0xFFFFFFAA,"USAGE : /recruit [playerid]"); return SendClientMessage(playerid,0xFFFFFFAA,"Used to recruit players into your faction."); } new victimid=strval(params); if(!IsPlayerConnected(victimid)) return SendClientMessage(playerid,0xFFFFFFAA,"Invalid Player ID!"); new playername[24],victimname[24],string[128]; GetPlayerName(playerid,playername,24); GetPlayerName(victimid,victimname,24); format(string,128,"%s.txt",udb_encode(victimname)); if(strcmp(playername,"Hector_Ramirez",false)==0) { dini_IntSet(string,"Rifas",1); format(string,128,"%s has recruited player %s into the Rifas!",playername,playerid,victimname,victimid); print(string); return SendClientMessageToAll(GetPlayerColor(playerid),string); } return 1; }