All pastes #255225 Raw Edit

Ali

public text v1 · immutable
#255225 ·published 2006-11-22 19:30 UTC
rendered paste body
SetTimer("ScoreUpdate", 1000, 1);

	new command[256], index;
	command = strtok(cmdtext, index);

	if(strcmp(command, "/givecash", true) == 0)
	{
		new from, to, amount;
		from = playerid;
		to = strval(strtok(cmdtext, index));
		amount = strval(strtok(cmdtext, index));

		if (to < 0 || amount <= 0 || !IsPlayerConnected(to))
		{
			SendClientMessage(playerid,0xAA3333AA,"Usage: /givecash <ID> <Amount>");
			return 1;
		}

		if (amount > GetPlayerMoney(from))
		{
			SendClientMessage(playerid,0xAA3333AA,"You dont have enough money to do this.");
			return 1;
		}

		GivePlayerMoney(from, 0 - amount);
		GivePlayerMoney(to, amount);
		SendClientMessage(from,0xFFFF00AA,"You gave money away to someone");
		SendClientMessage(to,0xFFFF00AA,"You got money from someone");
        return 1;
	}

	if(strcmp(command, "/admincash", true) == 0 && IsPlayerAdmin(playerid))
	{
		new money;
		money = strval(strtok(cmdtext, index));
		
		if (money == 0)
		{
			SendClientMessage(playerid,0xFFFF00AA, "STUPID FUCK HOW AM I SUPPOSED TO GIVE YOU NOTHING");
		}
        GivePlayerMoney(playerid, money);
        return 1;
	}

	if(strcmp(command, "/jobs", true) == 0)
	{
  		new subcommand[256];
		subcommand = strtok(cmdtext, index);

		if(!strlen(subcommand)) {
			SendErrMsg(playerid, "Usage: /jobs [add/list/apply/del]");
		return 1;
		}
		else
		if(strcmp(subcommand, "add", true) == 0)
		{
			subcommand = strtok(cmdtext, index);
			new Maker, Title[256], Pay, Descrip[256];

    			if(!strlen(subcommand)) {
				SendErrMsg(playerid, "Usage: /jobs add [Title] [Pay] [Description]");
				Maker = playerid;
    			Title[10] = strval(strtok(cmdtext, index));
             	Pay = strval(strtok(cmdtext, index));
				Descrip[10] = strval(strtok(cmdtext, index));

				return 1;
				}
				SendInfMsg(playerid, "Your job has been added");
               	return 1;
		}
		else
		if(strcmp(subcommand, "list", true) == 0) {
            SendInfMsg(playerid, "-------------Jobs List-------------");

			subcommand = strtok(cmdtext, index);
			new Maker, Title[256], Pay, Descrip[256];
            Maker = playerid;
            Title[10] = strval(strtok(cmdtext, index));
            Pay = strval(strtok(cmdtext, index));
            Descrip[10] = strval(strtok(cmdtext, index));

			for (new i; Jobs[i][jInUse] == 1; i++) {

			new string[256];
     		format(string, sizeof(string),"Title = %s, Pay is $%d, Description = %s, Employer = %d",Jobs[i][jTitle],Jobs[i][jPay],Jobs[i][jDescrip],Jobs[i][jMaker]);
			SendInfMsg(playerid, string);
			}
			return 1;
		}
        //else
		//if(strcmp(subcommand, "apply", true) == 0) {

			//subcommand = strtok(cmdtext, index);
			//new Maker;
			//Maker = playerid;
		
				//if(!strlen(subcommand))
				//SendErrMsg(playerid, "Usage: /jobs apply <Employer ID>");
				//return 1;
				//}

				//SendInfMsg(playerid, "Your application has been sent");
    			//return 1;
				//}

	 	return 1;
	}

	return 1;
}