17.05.2011, 09:41
Ty dude i only need one thing.
I want to make this command for weapondealer setprice(Shopslot,price);
But how can i make it?
Thats all what i need to know.
Код:
dcmd_setprice(playerid,params[])
{
new string[128];
new price;
new number;
if(sscanf(params, "i", price))
{
//SendClientMessage(playerid,COLOR_RED,"USAGE: /setprice (Amount)");
//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_MEDIC && gTeam[playerid] != TEAM_CARFIX && gTeam[playerid] != TEAM_DRIVER&& gTeam[playerid] != TEAM_GUNDEL)
{
SendClientMessage(playerid,COLOR_RED,"You cannot use this command with your class/skill.");
return 1;
}
if(gTeam[playerid] != TEAM_GUNDEL)
{
format(string,sizeof(string),"~n~~n~~n~~n~ ~n~~y~ 1 ~w~- Weapon1 $%d~n~~y~ 2 ~w~- Weapon2 $%d~n~~y~ 3 ~w~- Weapon3 $%d~n~~y~ 4 ~w~- Weapon4 $%d~n~~y~ 5 ~w~- Weapon5 $%d~n~~y~ 6 ~w~- Weapon6 $%d~n~~y~ 7 ~w~- Weapon7 $%d~n~~y~ 8 ~w~- Weapon8 $%d~n~~y~ 9 ~w~- Weapon9 $%d~n~~y~ 10 ~w~- Weapon10 $%d~n~",number==1,number==2);//SkillPrice[playerid]
TextDrawSetString(TextDraw4,string);
}
if(gTeam[playerid] != TEAM_GUNDEL)
{
if(sscanf(params, "i",number,price))
{
if(number==1)
{
SkillPrice[playerid] =price;
}
if(number==2)
{
SkillPrice[playerid] =price;
}
}
}
if(price > 50000 || price < 2000)
{
//SendClientMessage(playerid,COLOR_RED,"Please enter an amount between $2000 and $50000.");
//return 1;
}
SkillPrice[playerid] =price;
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Service Price Set_]]");
format(string,sizeof(string),"You have set your services price to $%d.",SkillPrice[playerid]);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
But how can i make it?
Thats all what i need to know.

