01.06.2010, 21:24
Hey guys I'm working on a drugs script but I want to be able to deal your drugs/
like /dealweed [id] [amount] [price]
I know how to just GIVE one weed to someone.
that would be somethnig like this:
But know I wanna make it like /dealweed [id] [amount] [price].
And the other one needs to /accept it.
Can someone please help me out and give a little explanation so I will learn something from it?
Thanks in Advance!
like /dealweed [id] [amount] [price]
I know how to just GIVE one weed to someone.
that would be somethnig like this:
Код:
dcmd_dealweed(playerid, params[])
{
if(PlayerInfo[playerid][Drugs] >= 1)
{
new tmp[256], tmp2[256], Index;
tmp = strtok(params,Index),
tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /dealweed [playerid]");
new player1,playername[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(!strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE: /dealweed [playerid]");
GetPlayerName(player1,playername,sizeof(playername));
format(string,sizeof(string),"You gived %s 1 weed",playername);
SendClientMessage(playerid,red,string);
PlayerInfo[player1][GSF] += 1;
SendClientMessage(player1,red,"You have +1 weed");
}
else SendClientMessage(playerid,red,"You don't have weed");
return 1;
}
}
And the other one needs to /accept it.
Can someone please help me out and give a little explanation so I will learn something from it?
Thanks in Advance!

