25.11.2011, 23:46
(
Последний раз редактировалось Rob_Maate; 25.11.2011 в 23:47.
Причина: fixed up typos + added edited other script
)
Use this... I haven't tested it so I'm not sure if it will compile
Also I have left out some parts where you will need to fill in your own variables.
But this command will allow you to give any player any amount of drugs, including negative amounts.
Also I have left out some parts where you will need to fill in your own variables.
But this command will allow you to give any player any amount of drugs, including negative amounts.
pawn Код:
if(strcmp(cmdtext, "/givedrugs", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(/*<insert your variable for checking admin level>*/)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givedrugs [PlayerID/PartOfName][Amount]");
return 1;
}
new playa;
new drugamount;
new result[64];
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
drugamount = strval(tmp);
if(playa != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "You were given %dg of drugs by an administrator.", drugamount);
SendClientMessage(playa, COLOR_LIGHTGREEN, string);
Drugs[playerid] += drugamount;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Not Authorized.");
}
}//not connected
return 1;
}