Author Topic: Help Please  (Read 3325 times)

0 Members and 1 Guest are viewing this topic.

Offline Dawood136

  • Street Thug
  • *
  • Posts: 28
    • View Profile
Help Please
« on: March 04, 2011, 08:00:08 am »
my !givecash is buged when some one do !givecash [playername/id] [ammount] it says invalid player i tried alot but it don't work

My Code :

      
Code: [Select]
else if (strcmp(cmd, "!givecash", true) == 0) {
        new tmp2[256], plr;
tmp = strtok(cmdtext, idx), tmp2 = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (!strlen(tmp2)) SendClientMessage(playerid,COLOR_GREEN, "USAGE: !givecash [Nick/ID] [Amount]");
else if (GetPlayerHandCash(gPlayers[playerid]) < StrToInt(tmp2)) SendClientMessage(playerid,COLOR_GREEN, "Error: You havent got the needed money.");
else if (plr != INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else if(!IsPlayerRegistered(gPlayers[plr])) SendClientMessage(playerid, COLOR_RED, "Error: That nick is not registered!");
else if (!IsNumeric(tmp2)) SendClientMessage(playerid,COLOR_GREEN, "Error: Invalid Amount!");
else {
format(szMsg,sizeof(szMsg),"You have sent:[ $%d ] to:[ %s ]",tmp,gPlayers[playerid]);
SendClientMessage(playerid,COLOR_GREEN, szMsg);
DecPlayerHandCash(playerid,StrToInt(tmp));
IncPlayerHandCash(plr,StrToInt(tmp));
}
return 1;
    }
Signed,
Dawood Sahi
DSS RPG Owner/Leader

Offline BIG[H]

  • Made Man
  • ***
  • Posts: 159
  • Sight of light
    • View Profile
Re: Help Please
« Reply #1 on: March 04, 2011, 11:12:02 am »
use /c givefuck to send cash
Outdoor city server Administrator, FS server owner!

Offline Dawood136

  • Street Thug
  • *
  • Posts: 28
    • View Profile
Re: Help Please
« Reply #2 on: March 08, 2011, 05:27:15 pm »
HELP HELP!!
Signed,
Dawood Sahi
DSS RPG Owner/Leader

yazeen

  • Guest
Re: Help Please
« Reply #3 on: March 08, 2011, 05:45:38 pm »
HELP HELP!!

simple

Code: [Select]

if(strcmp(cmd, "!givecash", true) == 0) {
    new giveplayerid, moneys;
    new giveplayer[MAX_PLAYER_NAME];
    new playermoney;
new sendername[MAX_PLAYER_NAME];
    new tmp[256];
tmp = strtok(cmdtext, idx);
new string[256];

if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: !givecash [playerid] [amount]");
return 1;
}
giveplayerid = strval(tmp);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: !givecash [playerid] [amount]");
return 1;
}
  moneys = strval(tmp);


if (giveplayerid == playerid) return SendClientMessage(playerid,COLOR_YELLOW,"You Cant Send Cash To Yourself");
if (IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys) {
SetPlayerMoney(playerid,playermoney-moneys);
SetPlayerMoney(giveplayerid,playermoney+moneys);
format(string, sizeof(string), "You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else {
SendClientMessage(playerid, COLOR_YELLOW, "Invalid cash amount.");
}
}
else {
format(string, sizeof(string), "%d is invalid player id.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}

Offline Dawood136

  • Street Thug
  • *
  • Posts: 28
    • View Profile
Re: Help Please
« Reply #4 on: March 09, 2011, 11:37:39 am »
Mr.Yazeen Do you revived me email on yahoo ?

Our Dss rpg script is sent to big and u , big is working on it many cmds are added
Signed,
Dawood Sahi
DSS RPG Owner/Leader

Offline Dawood136

  • Street Thug
  • *
  • Posts: 28
    • View Profile
Re: Help Please
« Reply #5 on: March 09, 2011, 11:45:19 am »
Problem Released , TOPIC CLOSED (LOCKED)
Signed,
Dawood Sahi
DSS RPG Owner/Leader