26.01.2015, 19:08
Foi postado pelo Don_Speed
Ola sou Don_Speed .
Estou a fazer este tutorial pro pessoal para de encher o meu saco pra fazer isso.
Os cara nem tem coragem de tentar aprender , simplesmente dizem que nao tem paciencia pra aprender , pagar tmb que e bom nada!
Bom vamos la , na include PPC_Defines e procure por isso
pawn Code:
#define ClassTruckDriver 1
#define ClassBusDriver 2
#define ClassPilot 3
#define ClassPolice 4
#define ClassMafia 5
#define ClassCourier 6
#define ClassAssistance 7
#define ClassRoadWorker 8
E adicione a que voce quer .
EX:
pawn Code:
#define ClassTruckDriver 1
#define ClassBusDriver 2
#define ClassPilot 3
#define ClassPolice 4
#define ClassMafia 5
#define ClassCourier 6
#define ClassAssistance 7
#define ClassRoadWorker 8
#define ClassIdiota 9//novo viu
Va em PPC_GameModeInit e coloque a sik da classe que criou em !
pawn Code:
GameModeInit_Classes()
{
AddPlayerClass(59, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 0 = Truck driver
AddPlayerClass(101, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 1 = Truck driver
AddPlayerClass(5, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 2 = Truck driver
AddPlayerClass(4, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 3 = Truck driver
AddPlayerClass(201, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 4 = Truck driver
AddPlayerClass(262, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 5 = Truck driver
AddPlayerClass(242, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 6 = Truck driver
AddPlayerClass(240, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 7 = Truck driver
AddPlayerClass(189, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 8 = Bus driver
AddPlayerClass(171, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 9 = Bus driver
AddPlayerClass(61, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 10 = Pilot
AddPlayerClass(284, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 11 = Police
AddPlayerClass(266, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 12 = Police
AddPlayerClass(285, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 13 = Police
AddPlayerClass(163, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 14 = Mafia
AddPlayerClass(164, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 15 = Mafia
AddPlayerClass(165, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 16 = Mafia
AddPlayerClass(217, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 17 = Courier
AddPlayerClass(211, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 18 = Courier
AddPlayerClass(268, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 19 = Assistance
AddPlayerClass(16, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 20 = Roadworker
AddPlayerClass(27, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 21 = Roadworker
AddPlayerClass(260, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 22 = Roadworker
//adicione no final de tudo EX:
AddPlayerClass(id skin, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
}
Agora para ele aparecerr na ecolha da classe voce deve ir no GM em OnPlayerRequestClass no .PWN do seu GM
pawn Code:
switch (classid)
{
case 0, 1, 2, 3, 4, 5, 6, 7:
{
GameTextForPlayer(playerid, TXT_ClassTrucker, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassTruckDriver;
}
case 8, 9:
{
GameTextForPlayer(playerid, TXT_ClassBusDriver, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassBusDriver;
}
case 10:
{
GameTextForPlayer(playerid, TXT_ClassPilot, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassPilot;
}
case 11, 12, 13:
{
GameTextForPlayer(playerid, TXT_ClassPolice, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassPolice;
}
case 14, 15, 16:
{
GameTextForPlayer(playerid, TXT_ClassMafia, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassMafia;
}
case 17, 18:
{
GameTextForPlayer(playerid, TXT_ClassCourier, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassCourier;
}
case 19:
{
GameTextForPlayer(playerid, TXT_ClassAssistance, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassAssistance;
}
case 20, 21, 22:
{
GameTextForPlayer(playerid, TXT_ClassRoadWorker, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassRoadWorker;
}
// Adiciona assim
case 23:// numero da skin na contagem
{
GameTextForPlayer(playerid, "Frase", 3000, 4);//Nome da class na Frase
APlayerData[playerid][PlayerClass] = Nome da Classe;//EX: ClassIdiota
}
}
Agora para fazer com que ele tenha frase ao spawnar e so ir em OnPlayerRequestSpawn
Vou dar um exemplo basico mas nao vale copiar
pawn Code:
switch (APlayerData[playerid][PlayerClass])// Isso ja tem no GM
{
case ClassIdiota:
{
format(Msg, 128, "{008A45}O Jogador {FFFFFF}%s {008A45}entrou no server como Idiota.", Name);
SetPlayerColor(playerid, 0x008A45FF);
}
}
#Edit
Colocar carros nessa prof
Primeira mente procure a definicao de seu vehicle
Estao encontrados na include PPC_Defines
Se nao tiver seu vehicle adiciona-lo
EX:
pawn Code:
#define VehicleFlatbed 455
#define VehicleDFT30 578 // Nome e id ddo vehicle
#define VehicleCementTruck 524
#define VehicleLineRunner 403
#define VehicleTanker 514
#define VehicleRoadTrain 515
#define VehicleTrailerCargo 435
#define VehicleTrailerCargo2 591
#define VehicleTrailerOre 450
#define VehicleTrailerFluids 584
#define VehicleCoach 437
#define VehicleShamal 519
#define VehicleNevada 553
#define VehicleStuntPlane 513
#define VehicleDodo 593
#define VehicleMaverick 487
#define VehicleCargobob 548
#define VehicleAT400 577
#define VehicleAndromada 592
#define VehiclePoliceLSPD 596
#define VehiclePoliceSFPD 597
#define VehiclePoliceLVPD 598
#define VehicleHPV1000 523
#define VehiclePoliceRanger 599
#define VehicleSandKing 495
#define VehicleMoonbeam 418
#define VehicleBike 509
#define VehicleBMX 481
#define VehicleMountainBike 510
#define VehicleFaggio 462
#define VehiclePizzaBoy 448
#define VehicleBF400 581
#define VehicleNRG500 522
#define VehiclePCJ600 461
#define VehicleFCR900 521
#define VehicleFreeway 463
#define VehicleWayfarer 586
#define VehicleSanchez 468
#define VehicleQuad 471
#define VehicleCoastguard 472
#define VehicleDinghy 473
#define VehicleJetmax 493
#define VehicleLaunch 595
#define VehicleMarquis 484
#define VehiclePredator 430
#define VehicleReefer 453
#define VehicleSpeeder 452
#define VehicleSquallo 446
#define VehicleTropic 454
#define VehicleRhino 432
#define VehiclePatriot 470
#define VehicleTowTruck 525
#define VehicleBurrito 482
#define VehicleFaggio 462
#define VehicleBenson 499
#define VehicleDozer 486
#define VehicleUtilityVan 552
#define VehicleUtilityTrailer 611
Agora para restrigi-lo apenas para sua prof va em OnPlayerStateChange No seu GameMode
Adicione e pronto
Apenas um exemplo!
pawn Code:
switch (newstate)
{
case PLAYER_STATE_DRIVER:
{
if (APlayerData[playerid][PlayerClass] != ClassIdiota)//clase que podera usar
{
if (AVehicleData[vid][StaticVehicle] == true)
{
switch (GetVehicleModel(vid))
{
case Nomes dos vehicles aqui:
{
RemovePlayerFromVehicle(playerid);
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vocк nгo pode usar um veнculo idiota.");
}
}
}
}
}
}
#Edit 2
Kkkkkkk Restringir comandos
EX:
pawn Code:
COMMAND:mauriliogostoso(playerid)
{
if(APlayerData[playerid][PlayerClass] == ClassIdiota)
{
//code
}else SendClientMessage(playerid,GetPlayerColor(playerid ),"[ERRO] Nao e idiota.");
return true;
}
// Metodo 2
COMMAND:mauriliogostoso(playerid)
{
if(APlayerData[playerid][PlayerClass] != ClassIdiota)return SendClientMessage(playerid,GetPlayerColor(playerid ),"[ERRO] Nao e idiota.");
//code
return true;
}
Bom espero ter ajudando!
ATENЗAO QUALQUER OUTRA DUVIDA SOBRE ESTE GM FALAR ESTAREI LHE AJUDANDO (NAO PEЗA CODE PRONTO).
CASO NAO TENHA INTENDIDO ALGO AVISA TAREI TENTANDO EXPLICAR MELHOR!
Uma bela explicaзгo mаs eu sei que neste comentario o mau.tito zuou mas essa e uma dъvida que todo mundo Tem
O mau.tito perguntou como que cria rotas que E comando /trabalar que ninguem ensina
Algum tutorial de como criar nao so o comando mas tambem as rotas ? Ou seja a dialog com as rotas.
Ola sou Don_Speed .
Estou a fazer este tutorial pro pessoal para de encher o meu saco pra fazer isso.
Os cara nem tem coragem de tentar aprender , simplesmente dizem que nao tem paciencia pra aprender , pagar tmb que e bom nada!
Bom vamos la , na include PPC_Defines e procure por isso
pawn Code:
#define ClassTruckDriver 1
#define ClassBusDriver 2
#define ClassPilot 3
#define ClassPolice 4
#define ClassMafia 5
#define ClassCourier 6
#define ClassAssistance 7
#define ClassRoadWorker 8
E adicione a que voce quer .
EX:
pawn Code:
#define ClassTruckDriver 1
#define ClassBusDriver 2
#define ClassPilot 3
#define ClassPolice 4
#define ClassMafia 5
#define ClassCourier 6
#define ClassAssistance 7
#define ClassRoadWorker 8
#define ClassIdiota 9//novo viu
Va em PPC_GameModeInit e coloque a sik da classe que criou em !
pawn Code:
GameModeInit_Classes()
{
AddPlayerClass(59, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 0 = Truck driver
AddPlayerClass(101, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 1 = Truck driver
AddPlayerClass(5, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 2 = Truck driver
AddPlayerClass(4, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 3 = Truck driver
AddPlayerClass(201, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 4 = Truck driver
AddPlayerClass(262, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 5 = Truck driver
AddPlayerClass(242, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 6 = Truck driver
AddPlayerClass(240, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 7 = Truck driver
AddPlayerClass(189, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 8 = Bus driver
AddPlayerClass(171, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 9 = Bus driver
AddPlayerClass(61, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 10 = Pilot
AddPlayerClass(284, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 11 = Police
AddPlayerClass(266, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 12 = Police
AddPlayerClass(285, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 13 = Police
AddPlayerClass(163, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 14 = Mafia
AddPlayerClass(164, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 15 = Mafia
AddPlayerClass(165, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 16 = Mafia
AddPlayerClass(217, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 17 = Courier
AddPlayerClass(211, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 18 = Courier
AddPlayerClass(268, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 19 = Assistance
AddPlayerClass(16, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 20 = Roadworker
AddPlayerClass(27, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 21 = Roadworker
AddPlayerClass(260, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 22 = Roadworker
//adicione no final de tudo EX:
AddPlayerClass(id skin, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
}
Agora para ele aparecerr na ecolha da classe voce deve ir no GM em OnPlayerRequestClass no .PWN do seu GM
pawn Code:
switch (classid)
{
case 0, 1, 2, 3, 4, 5, 6, 7:
{
GameTextForPlayer(playerid, TXT_ClassTrucker, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassTruckDriver;
}
case 8, 9:
{
GameTextForPlayer(playerid, TXT_ClassBusDriver, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassBusDriver;
}
case 10:
{
GameTextForPlayer(playerid, TXT_ClassPilot, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassPilot;
}
case 11, 12, 13:
{
GameTextForPlayer(playerid, TXT_ClassPolice, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassPolice;
}
case 14, 15, 16:
{
GameTextForPlayer(playerid, TXT_ClassMafia, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassMafia;
}
case 17, 18:
{
GameTextForPlayer(playerid, TXT_ClassCourier, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassCourier;
}
case 19:
{
GameTextForPlayer(playerid, TXT_ClassAssistance, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassAssistance;
}
case 20, 21, 22:
{
GameTextForPlayer(playerid, TXT_ClassRoadWorker, 3000, 4);
APlayerData[playerid][PlayerClass] = ClassRoadWorker;
}
// Adiciona assim
case 23:// numero da skin na contagem
{
GameTextForPlayer(playerid, "Frase", 3000, 4);//Nome da class na Frase
APlayerData[playerid][PlayerClass] = Nome da Classe;//EX: ClassIdiota
}
}
Agora para fazer com que ele tenha frase ao spawnar e so ir em OnPlayerRequestSpawn
Vou dar um exemplo basico mas nao vale copiar
pawn Code:
switch (APlayerData[playerid][PlayerClass])// Isso ja tem no GM
{
case ClassIdiota:
{
format(Msg, 128, "{008A45}O Jogador {FFFFFF}%s {008A45}entrou no server como Idiota.", Name);
SetPlayerColor(playerid, 0x008A45FF);
}
}
#Edit
Colocar carros nessa prof
Primeira mente procure a definicao de seu vehicle
Estao encontrados na include PPC_Defines
Se nao tiver seu vehicle adiciona-lo
EX:
pawn Code:
#define VehicleFlatbed 455
#define VehicleDFT30 578 // Nome e id ddo vehicle
#define VehicleCementTruck 524
#define VehicleLineRunner 403
#define VehicleTanker 514
#define VehicleRoadTrain 515
#define VehicleTrailerCargo 435
#define VehicleTrailerCargo2 591
#define VehicleTrailerOre 450
#define VehicleTrailerFluids 584
#define VehicleCoach 437
#define VehicleShamal 519
#define VehicleNevada 553
#define VehicleStuntPlane 513
#define VehicleDodo 593
#define VehicleMaverick 487
#define VehicleCargobob 548
#define VehicleAT400 577
#define VehicleAndromada 592
#define VehiclePoliceLSPD 596
#define VehiclePoliceSFPD 597
#define VehiclePoliceLVPD 598
#define VehicleHPV1000 523
#define VehiclePoliceRanger 599
#define VehicleSandKing 495
#define VehicleMoonbeam 418
#define VehicleBike 509
#define VehicleBMX 481
#define VehicleMountainBike 510
#define VehicleFaggio 462
#define VehiclePizzaBoy 448
#define VehicleBF400 581
#define VehicleNRG500 522
#define VehiclePCJ600 461
#define VehicleFCR900 521
#define VehicleFreeway 463
#define VehicleWayfarer 586
#define VehicleSanchez 468
#define VehicleQuad 471
#define VehicleCoastguard 472
#define VehicleDinghy 473
#define VehicleJetmax 493
#define VehicleLaunch 595
#define VehicleMarquis 484
#define VehiclePredator 430
#define VehicleReefer 453
#define VehicleSpeeder 452
#define VehicleSquallo 446
#define VehicleTropic 454
#define VehicleRhino 432
#define VehiclePatriot 470
#define VehicleTowTruck 525
#define VehicleBurrito 482
#define VehicleFaggio 462
#define VehicleBenson 499
#define VehicleDozer 486
#define VehicleUtilityVan 552
#define VehicleUtilityTrailer 611
Agora para restrigi-lo apenas para sua prof va em OnPlayerStateChange No seu GameMode
Adicione e pronto
Apenas um exemplo!
pawn Code:
switch (newstate)
{
case PLAYER_STATE_DRIVER:
{
if (APlayerData[playerid][PlayerClass] != ClassIdiota)//clase que podera usar
{
if (AVehicleData[vid][StaticVehicle] == true)
{
switch (GetVehicleModel(vid))
{
case Nomes dos vehicles aqui:
{
RemovePlayerFromVehicle(playerid);
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vocк nгo pode usar um veнculo idiota.");
}
}
}
}
}
}
#Edit 2
Kkkkkkk Restringir comandos
EX:
pawn Code:
COMMAND:mauriliogostoso(playerid)
{
if(APlayerData[playerid][PlayerClass] == ClassIdiota)
{
//code
}else SendClientMessage(playerid,GetPlayerColor(playerid ),"[ERRO] Nao e idiota.");
return true;
}
// Metodo 2
COMMAND:mauriliogostoso(playerid)
{
if(APlayerData[playerid][PlayerClass] != ClassIdiota)return SendClientMessage(playerid,GetPlayerColor(playerid ),"[ERRO] Nao e idiota.");
//code
return true;
}
Bom espero ter ajudando!
ATENЗAO QUALQUER OUTRA DUVIDA SOBRE ESTE GM FALAR ESTAREI LHE AJUDANDO (NAO PEЗA CODE PRONTO).
CASO NAO TENHA INTENDIDO ALGO AVISA TAREI TENTANDO EXPLICAR MELHOR!
Uma bela explicaзгo mаs eu sei que neste comentario o mau.tito zuou mas essa e uma dъvida que todo mundo Tem
O mau.tito perguntou como que cria rotas que E comando /trabalar que ninguem ensina
Algum tutorial de como criar nao so o comando mas tambem as rotas ? Ou seja a dialog com as rotas.