Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ocmd:accept(playerid,params[])
- {
- new string[64],msg[64],msg2[64];
- if(sscanf(params,"s[64]",string)) return SendClientMessage(playerid,COLOR_GOLD,"USAGE: /accept [invite,heal]");
- if(!strcmp(string,"heal",false))
- {
- if(GetPVarInt(playerid,"inv_healamount") == 0) return SendClientMessage(playerid,COLOR_RED,"Nobody asked to heal you.");
- //if(!IsPlayerInRangeOfPoint(playerid,7,X,Y,Z);
- new healamount = GetPVarInt(playerid,"inv_healamount");
- SetPlayerHealth(playerid,GetPVarInt(playerid,"inv_healamount"));
- GivePlayerMoney(playerid,-MEDIC_MONEY_GAIN_HEAL_AMOUNT);
- GivePlayerMoney(GetPVarInt(playerid,"inv_inviterID"),MEDIC_MONEY_GAIN_HEAL_AMOUNT);
- format(msg,sizeof(msg),"Medic %s just healed you to %i HP!",PlayerName(GetPVarInt(playerid,"inv_inviterID")),healamount);
- format(msg2,sizeof(msg2),"You healed Player %s by %i HP!",PlayerName(playerid),healamount);
- SendClientMessage(playerid,COLOR_GREEN,msg);
- SendClientMessage(GetPVarInt(playerid,"inv_inviterID"),COLOR_GREEN,msg2);
- return 1;
- }
- if(!strcmp(string,"invite",false))
- {
- if(GetPVarInt(playerid,"inv_factID") == 0) return SendClientMessage(playerid,COLOR_RED,"You havent been invited to a faction.");
- new fID = GetPVarInt(playerid,"inv_factID");
- pInfo[playerid][faction] = fID;
- pInfo[playerid][rank] = 1;
- switch(pInfo[playerid][faction])
- {
- case 1:
- {
- pInfo[playerid][skin] = 280;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 2:
- {
- pInfo[playerid][skin] = 165;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 3:
- {
- pInfo[playerid][skin] = 274;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 4:
- {
- pInfo[playerid][skin] = 277;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 5:
- {
- pInfo[playerid][skin] = 106;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 6:
- {
- pInfo[playerid][skin] = 102;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 7:
- {
- pInfo[playerid][skin] = 109;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 8:
- {
- pInfo[playerid][skin] = 116;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 9:
- {
- pInfo[playerid][skin] = 17;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- case 10:
- {
- pInfo[playerid][skin] = 50;
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- }
- format(msg,sizeof(msg),"You joined the faction %s !",fInfo[pInfo[playerid][faction]][f_name]);
- SendClientMessage(playerid,COLOR_GREEN,msg);
- format(msg2,sizeof(msg2),"%s has joined your faction %s",PlayerName(playerid),fInfo[pInfo[playerid][faction]][f_name]);
- SendClientMessage(GetPVarInt(playerid,"inv_inviterID"),COLOR_GREEN,msg2);
- new Float:X = fInfo[pInfo[playerid][faction]][f_x],Float:Y = fInfo[pInfo[playerid][faction]][f_y],Float:Z = fInfo[pInfo[playerid][faction]][f_z],Float:A = fInfo[pInfo[playerid][faction]][f_a];
- SetSpawnInfo(playerid,pInfo[playerid][faction],pInfo[playerid][skin],X,Y,Z,A,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement