18.05.2011, 21:09
Heey all,
I am busy with a weapondealer job. And i want to make that a normal player can do /weapons to show the shop from the closest weapondealer but i dont know how to make this. Here i have a command from the weapondealer but i just want that the normal player can show the shop from the weapondealler not that the weapondealler shows the shop to the player>
Pls Anyone can help me out?
I am busy with a weapondealer job. And i want to make that a normal player can do /weapons to show the shop from the closest weapondealer but i dont know how to make this. Here i have a command from the weapondealer but i just want that the normal player can show the shop from the weapondealler not that the weapondealler shows the shop to the player>
Код:
`dcmd_showweapons(playerid,params[]) { new string[128]; new ID; if(sscanf(params, "u", ID)) { SendClientMessage(playerid,COLOR_RED,"USAGE: /showweapons (Player Name/ID)"); return 1; } if(IsKidnapped[playerid] == 1) { SendClientMessage(playerid,COLOR_RED,"You are kidnapped. You cannot use this command."); return 1; } if(IsSpawned[playerid] != 1) { SendClientMessage(playerid,COLOR_RED,"You must be alive and spawned in order to be able to use this command."); return 1; } if(gTeam[playerid] != TEAM_GUNDEL) { SendClientMessage(playerid,COLOR_RED,"Only Weapon Dealers can show people their weapons for sale."); return 1; } if(!IsPlayerConnected(ID)) { format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give them weapons",ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(GetDistanceBetweenPlayers(playerid,ID) > 4) { format(string,sizeof(string),"%s(%d) is too far away. You cannot reach him to show him weapons.",PlayerName(ID),ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } /*if(gTeam[ID] == TEAM_GUNDEL) { SendClientMessage(playerid,COLOR_RED,"You cannot give other Weapon Dealers weapons .. Im sure they have plenty."); return 1; }*/ /*if(playerid == ID) { SendClientMessage(playerid,COLOR_RED,"You cannot give yourself weapons. Go to Ammunation to get some."); return 1; }*/ if(IsSpawned[ID] != 1) { format(string,sizeof(string),"%s(%d) is not spawned. You cannot give dead people weapons ..",PlayerName(ID),ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } /*if(CalledForWeaponDealer[ID] == 0) { SendClientMessage(playerid,COLOR_RED,"They have not called for a weapon dealer. You cannot give them weapons."); return 1; }*/ //if(arm1==1) //{ //GivePlayerMoney(playerid,SkillPrice[playerid]); //TextDrawHideForPlayer(ID,TextDraw4[playerid]); //} if(GetDistanceBetweenPlayers(playerid,ID) <= 4) { SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Weapon list shown_]]"); //format(string,sizeof(string),"~n~~n~~n~~n~ ~n~~y~ 1 ~w~- M4 ~g~$5000~n~~y~ 2 ~w~- Tec-9 ~g~$5000~n~~y~ 3 ~w~- Sniper ~g~$5000~n~~y~ 4 ~w~- Combat Shotgun ~g~$7000~n~~y~ 5 ~w~- Deagle $5000~n~~y~ 6 ~w~- Armour $1000~n~~y~ 7 ~w~- Coming soon. $--~n~~y~ 8 ~w~- Coming soon. $--~n~~y~ 9 ~w~- Comming soon. $%d~n~~y~ 10 ~w~- Coming soon. $--~n~"); //TextDrawSetString(TextDraw4[playerid],string); TextDrawShowForPlayer(ID,TextDraw4); armshop[ID]=1; SetPVarInt(ID, "arm1", playerid); return 1; } return 1; }