12.02.2010, 04:20
Please help me im trynna make it so u can only sell a materials with this code shown below
how do i make it so u cant sell more then wat u got..
if(strcmp(cmd, "/sella", true) == 0)
{
if (PlayerInfo[playerid][pJob] != 9)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /sella [playerid/PartOfName] [amount]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /sella [playerid/PartOfName] [amount]");
return 1;
}
new playa;
GetPlayerName(playa, sendername, sizeof(sendername));
playa = ReturnUser(tmp);
moneys = strval(tmp);
PlayerInfo[giveplayerid][pMatsA] = moneys;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "[ADMIN] %s has given %s %d materials.", sendername,giveplayer,moneys);
ABroadCast(COLOR_YELLOW,string,1);
}
}
return 1;
}
how do i make it so u cant sell more then wat u got..
if(strcmp(cmd, "/sella", true) == 0)
{
if (PlayerInfo[playerid][pJob] != 9)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /sella [playerid/PartOfName] [amount]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /sella [playerid/PartOfName] [amount]");
return 1;
}
new playa;
GetPlayerName(playa, sendername, sizeof(sendername));
playa = ReturnUser(tmp);
moneys = strval(tmp);
PlayerInfo[giveplayerid][pMatsA] = moneys;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "[ADMIN] %s has given %s %d materials.", sendername,giveplayer,moneys);
ABroadCast(COLOR_YELLOW,string,1);
}
}
return 1;
}