08.02.2009, 10:02
So what is the code supposed to do
that goes underneeath OnPlayerRequestSpawn
Then I've got the dcmd(recruit,7,cmdtext); under OnPlayerCommandText
then this at the bottom of the script
It compiles fine but i think there are a few bugs with the userfiles, like Ive already made a registration system. Would any of this code need to go in the registration script?
Код:
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)
{
}
}
Then I've got the dcmd(recruit,7,cmdtext); under OnPlayerCommandText
then this at the bottom of the script
Код:
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;
}

