[Ajuda] Trabalho/Skin/Categoria/Score
#1

Olб novamente, preciso de ajuda... estou estudando alguns gms, fs, mбs tenho dъvidas ainda. Vamos lб: quero criar uma profissгo, tipo "/fazendeiro" -> inicia as missхes (code abaixo), eis a duvida: Queria aprender como definir uma categoria tipo: " Skin, Cor, Comando somente para a profissao, Trabalho jб iniciado, fim do trabalho = 1score ao player + o $ ", mбs nгo tenho idйia de como fazer isto. Code
* ao digitar "/comando" lozaliza o ponto mais prуximo do player (random). Os fins nгo sгo para a profissao fazendeiro, e sim alguma outra, como motorista de taxi, ou onibus, nгo sei ainda.

Quote:

new combinejobrunning = 0;
new info;

forward GivePlayerOneExp(playerid);

public OnFilterScriptInit()
{
AddStaticVehicleEx(532,-370.1018,-1463.1403,26.6953,287.0754,0,0,10); // combine 1
AddStaticVehicleEx(532,-364.2571,-1479.7140,26.7041,285.6486,0,0,10); // combine 2
AddStaticVehicleEx(532,-361.6030,-1501.2618,24.8698,285.8201,0,0,10); // combine 3

info = CreatePickup(1239,1,-366.1941,-1440.3253,25.7266,-1);
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/combine", cmdtext, true, 10) == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 532)
{
SetPlayerCheckpoint(playerid, Checkpoint1, 3.0);
CreateObject(823,-256.0010,-1542.3809,3.9930,0,0,0);
combinejobrunning = 1;
GameTextForPlayer(playerid, "~g~You started the job, good luck!", 3000, 3);
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s is now doing the Combine job.", name );
SendClientMessageToAll(COLOR_RED, string);
return 1;
}
SendClientMessage(playerid, COLOR_RED,"You have to be in a truck to start the job");
}

if (strcmp("/combineinfo", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "You need the harvest the weed.");
SendClientMessage(playerid, COLOR_YELLOW, "If you enter the combine, type /combine and a red marker will appear.");
SendClientMessage(playerid, COLOR_YELLOW, "Just drive to the markers and you're done.");
return 1;
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 532)
{
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint1))
{
SetPlayerCheckpoint(playerid, Checkpoint2, 7.0);
CreateObject(823,-231.8289,-1467.9810,4.9421,0,0,0);
}
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint2))
{
SetPlayerCheckpoint(playerid, Checkpoint3, 7.0);
CreateObject(823,-193.9747,-1375.2502,4.7856,0,0,0);
}
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint3))
{
SetPlayerCheckpoint(playerid, Checkpoint4, 7.0);
CreateObject(823,-246.0348,-1326.1063,8.9300,0,0,0);
}
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint4))
{
SetPlayerCheckpoint(playerid, Checkpoint5, 7.0);
CreateObject(823,-407.1459,-1371.5518,23.6588,0,0,0);
}
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint5))
{
SetPlayerCheckpoint(playerid, Checkpoint6, 7.0);
CreateObject(823,-564.7697,-1302.4977,22.5511,0,0,0);
}
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint6))
{
SetPlayerCheckpoint(playerid, Checkpoint7, 7.0);
}
if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint7))
{
GivePlayerMoney(playerid, 10000);
GameTextForPlayer(playerid, "~g~You Completed the job, well done!", 3000, 3);
SetVehicleToRespawn(2);
combinejobrunning = 0;
DisablePlayerCheckpoint(playerid);
}
}
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 532)
{
SendClientMessage(playerid, COLOR_RED, "You can start the combine-job with /combine");
}
return 0;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if((combinejobrunning) == 1)
{
combinejobrunning = 0;
SendClientMessage(playerid, COLOR_RED, "You left your combine behind, get in again if you want to continue your job.");

}else if((combinejobrunning) == 0){

return 1;
}
}

Nгo pretendo usar este code, й sу para estudo/exemplo abз, Th.
Reply


Messages In This Thread
Trabalho/Skin/Categoria/Score (profissao) - by Thiffy - 15.04.2015, 14:05

Forum Jump:


Users browsing this thread: 1 Guest(s)