All pastes #250981 Raw Edit

Script/Errors

public text v1 · immutable
#250981 ·published 2006-11-17 16:39 UTC
rendered paste body
#include <a_samp>

main()
{
	print("\n----------------------------------");
	print("  Code Testing by Ali");
	print("----------------------------------\n");
}



enum JobsEnum {
Title[256],
Pay,
Descrip[256],
Maker
}
new Jobs[][JobsEnum];







public OnGameModeInit()
{
	print("GameModeInit()");
	SetGameModeText("Code Testing");

		 new LoadSkins[] = { 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117 };
for (new i; i < sizeof(LoadSkins); i++) {


//-------------------------------Skins------------------------------------------//


	AddPlayerClass(LoadSkins[i], 1958.3783, 1343.1572, 15.3746, 269.1425, 22, 3000, 31, 3000, 32, 3000);
}
   



//-----------------------------Pickups------------------------------------------//


	AddStaticPickup(370, 2, 2031.0907,1338.4077,10.8203); // jetpack
    AddStaticPickup(1240, 2, 2023.5238,1338.1635,10.8203); // health
    AddStaticPickup(1242, 2, 2031.2104,1346.2709,10.8203); // armour

    




//---------------------------Spawn Cars-----------------------------------------//


	AddStaticVehicle(411,2023.5308,1334.5774,10.1466,270.5545,0,0); // Black Infernus - Spawn
    AddStaticVehicle(411,2021.9280,1351.7144,9.9506,269.4601,0,0); // Black Infernus - Spawn
    AddStaticVehicle(560,2032.0262,1329.8737,10.5258,311.3071,0,0); // Black Sultan - Spawn
    AddStaticVehicle(560,2031.6089,1358.3645,10.5251,220.7157,0,0); // Black Sultan - Spawn
    AddStaticVehicle(602,2027.2617,1329.9399,10.5253,315.6829,0,0); // Black Alpha - Spawn
    AddStaticVehicle(602,2027.2075,1356.5769,10.5255,215.7004,0,0); // Black Alpha - Spawn
    AddStaticVehicle(592,1477.2406,1248.1947,10.6262,0.9756,0,0); // Andromeda


Jobs[0][Title] = "Testing";
Jobs[0][Pay] = 10000;
Jobs[0][Descrip] = "You are testing in the correct direction";
Jobs[0][Maker] = 0;

    return 1;
}

//----------------------------other crap----------------------------------------//


public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerFacingAngle(playerid, 50.1425);
	printf("OnPlayerRequestClass(%d, %d)", playerid, classid);
	SetPlayerPos(playerid, 1961.8290,1593.4952,75.7188);
	SetPlayerCameraPos(playerid, 1959.3132,1594.7886,76.3009);
	SetPlayerCameraLookAt(playerid, 1961.8290,1593.4952,75.7188);
	return 1;
}

public OnGameModeExit()
{
	print("GameModeExit()");
	return 1;
}

public OnPlayerConnect(playerid)
{
	printf("OnPlayerConnect(%d)", playerid);
	return 1;
}

public OnPlayerDisconnect(playerid)
{
	printf("OnPlayerDisconnect(%d)", playerid);
	return 1;
}

public OnPlayerSpawn(playerid)
{
	printf("OnPlayerSpawn(%d)", playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	printf("OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason);
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	printf("OnVehicleSpawn(%d)", vehicleid);
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	printf("OnVehicleDeath(%d, %d)", vehicleid, killerid);
	return 1;
}

SendErrMsg(playerid, message[])
{
new string[256];
format(string, sizeof(string), "* %s",message);
SendClientMessage(playerid,0xAA3333AA,string);
return 1;
}

public OnPlayerText(playerid)
{
	printf("OnPlayerText(%d)", playerid);
	return 1;
}


//------------------------------good Stuff--------------------------------------//

public OnPlayerCommandText(playerid, cmdtext[])
{

             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(strcmp(subcommand, "add", true) == 0)
			  {


                      SendErrMsg(playerid, "Usage: /job add <Job Title> <Pay> <Description>");

                      new Maker, Title, Pay, Descrip;

					  Maker = playerid;

					  Title = strval(strtok(cmdtext, index));

					  Pay = strval(strtok(cmdtext, index));

					  Descrip = strval(strtok(cmdtext, index));

                      return 1;

               

			  }

              if(strcmp(subcommand, "list", true) == 0)
              
              


			   

					  return 1;
					  
			  }



              return 1;

}





//------------------------------------End of good stuff :(----------------------//



public OnPlayerInfoChange(playerid)
{
	printf("OnPlayerInfoChange(%d)");
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	printf("OnPlayerEnterVehicle(%d, %d, %d)", playerid, vehicleid, ispassenger);
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	printf("OnPlayerExitVehicle(%d, %d)", playerid, vehicleid);
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	printf("OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate);
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	printf("OnPlayerEnterCheckpoint(%d)", playerid);
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	printf("OnPlayerLeaveCheckpoint(%d)", playerid);
	return 1;
}

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' ')){index++;}
    new offset = index,result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {result[index - offset] = string[index];index++;}result[index - offset] = EOS;
    return result;
}