//----------------------------------[Forзar Refazer Tutorial]-----------------------------------------------
if(strcmp(cmd, "/forcartutorial", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrabalhando[playerid] < 1)
{
SendClientMessage(playerid, COR_GRAD1, "Vocк nгo estб no Modo Administrador! (/trabalhar)");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COR_GRAD1, "Forma de Uso: /forcartutorial [ID do Jogador ou Nome do Jogador] [Motivo]");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COR_GRAD2, "Forma de Uso: /forcartutorial [ID do Jogador ou Nome do Jogador] [Motivo]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
PlayerInfo[giveplayerid][pTut] = 2;
ShowPlayerDialog(giveplayerid, 9, DIALOG_STYLE_MSGBOX, "•••• [Boas Vindas] ••••", "•Olб! Antes de Comeзarmos o Tutorial do Brazilian Way of Life[RPG BRASIL], iremos a uma breve explicaзгo.\n•Apуs essa explicaзгo, comeзara o Tutorial.\n•Poderб sair do Tutorial a qualquer Momento, apertando o botгo ‘Sair do SV’ Poderб sair do Tutorial a qualquer Momento, apertando o botгo ‘Sair do SV’.\n•Clique em Prуximo para Prosseguir ou em Sair do SV para voltar mais tarde.", "Confirma", "Sair do Sv");
format(string, sizeof(string), "* O Administrador %s [ID:%d] forзou o Jogador %s [ID:%d] a Refazer o Tutorial do BWL!!. O Motivo foi: %s", sendername, playerid, giveplayer, giveplayerid, (result));
SendClientMessageToAll(COR_LIGHTBLUE,string);
}
else
{
SendClientMessage(playerid, COR_GRAD1, "O Jogador estб Offline");
}
}
else
{
SendClientMessage(playerid, COR_GREY, "Vocк nгo й um Administrador!");
}
}
return 1;
}
Ela й relacionada ao 'Motivo'. Se o administrador digitar nada no motivo, co CMD nгo irб 'funcionar'.
|
while ((index < length) && (string[index] > ' ')
stock split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc))
{
if(strsrc[i] == delimiter || i == strlen(strsrc))
{
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
if(strcmp(cmd, "/forcartutorial", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrabalhando[playerid] < 1) return SendClientMessage(playerid, COR_GRAD1, "Vocк nгo estб no Modo Administrador! (/trabalhar)");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COR_GRAD1, "Forma de Uso: /forcartutorial [ID do Jogador ou Nome do Jogador] [Motivo]");
new givepa;
givepa = strval(tmp);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, COR_GRAD2, "Forma de Uso: /forcartutorial [ID do Jogador ou Nome do Jogador] [Motivo]");
if(IsPlayerConnected(givepa))
{
GetPlayerName(givepa, giveplayer, sizeof(giveplayer));
PlayerInfo[givepa][pTut] = 2;
ShowPlayerDialog(givepa, 9, DIALOG_STYLE_MSGBOX, "•••• [Boas Vindas] ••••", "•Olб! Antes de Comeзarmos o Tutorial do Brazilian Way of Life[RPG BRASIL], iremos a uma breve explicaзгo.\n•Apуs essa explicaзгo, comeзara o Tutorial.\n•Poderб sair do Tutorial a qualquer Momento, apertando o botгo ‘Sair do SV’ Poderб sair do Tutorial a qualquer Momento, apertando o botгo ‘Sair do SV’.\n•Clique em Prуximo para Prosseguir ou em Sair do SV para voltar mais tarde.", "Confirma", "Sair do Sv");
format(string, sizeof(string), "* O Administrador %s [ID:%d] forзou o Jogador %s [ID:%d] a Refazer o Tutorial do BWL!!. O Motivo foi: %s", sendername, playerid, giveplayer, givepa, (result));
SendClientMessageToAll(COR_LIGHTBLUE,string);
}
else
{
SendClientMessage(playerid, COR_GRAD1, "O Jogador estб Offline");
}
}
else
{
SendClientMessage(playerid, COR_GREY, "Vocк nгo й um Administrador!");
}
}
return 1;
}
if(strcmp(cmdtext, "/carro", true) == 0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateVehicle(560, X, Y+2, Z, -1, -1);
return 1;
}
/carro [ID]
#include <a_samp>
#include <dudb>
#pragma unused ret_memcpy
new
IsOccupied[MAX_VEHICLES]
;
public OnGameModeInit()
{
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
main()
print("test");
new
VehicleNames[212][] =
{
"Landstalker",
"Bravura",
"Buffalo",
"Linerunner",
"Pereniel",
"Sentinel",
"Dumper",
"Firetruck",
"Trashmaster",
"Stretch",
"Manana",
"Infernus",
"Voodoo",
"Pony",
"Mule",
"Cheetah",
"Ambulance",
"Leviathan",
"Moonbeam",
"Esperanto",
"Taxi",
"Washington",
"Bobcat",
"Mr-Whoopee",
"BF-Injection",
"Hunter",
"Premier",
"Enforcer",
"Securicar",
"Banshee",
"Predator",
"Bus",
"Rhino",
"Barracks",
"Hotknife",
"Trailer",
"Previon",
"Coach",
"Cabbie",
"Stallion",
"Rumpo",
"RC-Bandit",
"Romero",
"Packer",
"Monster",
"Admiral",
"Squalo",
"Seasparrow",
"Pizzaboy",
"Tram",
"Trailer",
"Turismo",
"Speeder",
"Reefer",
"Tropic",
"Flatbed",
"Yankee",
"Caddy",
"Solair",
"Berkley's-RC-Van",
"Skimmer",
"PCJ-600",
"Faggio",
"Freeway",
"RC Baron",
"RC Raider",
"Glendale",
"Oceanic",
"Sanchez",
"Sparrow",
"Patriot",
"Quad",
"Coastguard",
"Dinghy",
"Hermes",
"Sabre",
"Rustler",
"ZR3-50",
"Walton",
"Regina",
"Comet",
"BMX",
"Burrito",
"Camper",
"Marquis",
"Baggage",
"Dozer",
"Maverick",
"News Chopper",
"Rancher",
"FBI Rancher",
"Virgo",
"Greenwood",
"Jetmax",
"Hotring",
"Sandking",
"Blista-Compact",
"Police-Maverick",
"Boxville",
"Benson",
"Mesa",
"RC-Goblin",
"Hotring-Racer",
"Hotring-Racer",
"Bloodring-Banger",
"Rancher",
"Super GT",
"Elegant",
"Journey",
"Bike",
"Mountain Bike",
"Beagle",
"Cropdust",
"Stunt",
"Tanker",
"RoadTrain",
"Nebula",
"Majestic",
"Buccaneer",
"Shamal",
"Hydra",
"FCR-900",
"NRG-500",
"HPV1000",
"Cement-Truck",
"Tow-Truck",
"Fortune",
"Cadrona",
"FBI-Truck",
"Willard",
"Forklift",
"Tractor",
"Combine",
"Feltzer",
"Remington",
"Slamvan",
"Blade",
"Freight",
"Streak",
"Vortex",
"Vincent",
"Bullet",
"Clover",
"Sadler",
"Firetruck",
"Hustler",
"Intruder",
"Primo",
"Cargobob",
"Tampa",
"Sunrise",
"Merit",
"Utility",
"Nevada",
"Yosemite",
"Windsor",
"Monster-A",
"Monster-B",
"Uranus",
"Jester",
"Sultan",
"Stratum",
"Elegy",
"Raindance",
"RC-Tiger",
"Flash",
"Tahoma",
"Savanna",
"Bandito",
"Freight",
"Trailer",
"Kart",
"Mower",
"Duneride",
"Sweeper",
"Broadway",
"Tornado",
"AT-400",
"DFT-30",
"Huntley",
"Stafford",
"BF-400",
"Newsvan",
"Tug",
"Trailer",
"Emperor",
"Wayfarer",
"Euros",
"Hotdog",
"Club",
"Trailer-B",
"Trailer-C",
"Andromada",
"Dodo",
"RC-CaLm",
"Launch",
"Police Car [LSPD]",
"Police Car [SFPD]",
"Police Car [LVPD]",
"Police Ranger",
"Picador",
"S.W.A.T",
"Alpha",
"Phoenix",
"Glendale",
"Sadler",
"Luggage Trailer",
"Luggage Trailer",
"Stair Trailer",
"Boxville",
"Farm Plow",
"Utility Trailer"
};
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
IsOccupied[vehicleid] = 0;
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
IsOccupied[vehicleid] = 0;
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new
cmd[256],
idx,
tmp[256]
;
cmd = strtok(cmdtext, idx);
if (strcmp("/createcar", cmd, true, 10) == 0)
{
new
ida
;
tmp = strtok(cmdtext,idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xAA3333AA, "Uso: /createcar [Nome/ID]");
if(!IsNumeric(tmp)) ida = GetVehicleModelIDFromName(tmp); else ida = strval(tmp);
if(ida < 400 || ida > 603) return SendClientMessage(playerid ,0xAA3333AA,"Modelo Invalido");
CreatePlayerVehicle(playerid, ida);
return 1;
}
if (strcmp("/destroy1", cmd, true, 10) == 0)
{
ResetarVeiculos();
return 1;
}
if (strcmp("/destroy2", cmd, true, 10) == 0)
{
ResetarVeiculos2();
return 1;
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
IsOccupied[vehicleid] = 1;
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
IsOccupied[vehicleid] = 0;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock
CreatePlayerVehicle(playerid, modelid)
{
new
vehicle,
Float:pos[4]
;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
vehicle = GetPlayerVehicleID(playerid);
GetVehiclePos(vehicle, pos[0], pos[1], pos[2]);
GetVehicleZAngle(vehicle, pos[3]);
DestroyVehicle(vehicle);
}
else
{
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
}
vehicle = AddStaticVehicle( modelid, pos[0], pos[1], (pos[2] + 1),pos[3],-1,-1);
LinkVehicleToInterior(vehicle, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(vehicle, GetPlayerVirtualWorld(playerid));
PlayerPlaySound(playerid,1133,0,0,0);
return 1;
}
IsNumeric(const stringf[])
{
for (new g = 0, kho = strlen(stringf); g < kho; g++)
{
if (stringf[g] > '9' || stringf[g] < '0') return 0;
}
return 1;
}
GetVehicleModelIDFromName(vname[])
{
for(new i = 0; i < 211; i++)
{
if ( strfind(VehicleNames[i], vname, true) != -1 )
return i + 400;
}
return -1;
}
stock ResetarVeiculos()
{
new
time = GetTickCount()
;
for( new j = 0; j < MAX_VEHICLES; j++)
{
for( new p = 0; p < MAX_PLAYERS; p++)
if(!IsPlayerInVehicle(p,j))
{
SetVehicleToRespawn(j);
}
}
printf("Tick Count 1: %d",(GetTickCount() - time)*100000);
return 1;
}
stock ResetarVeiculos2()
{
new
time = GetTickCount()
;
for( new j = 0; j < MAX_VEHICLES; j++)
{
if(IsOccupied[j] == 0)
{
SetVehicleToRespawn(j);
}
}
printf("Tick Count 2: %d",(GetTickCount() - time)*100000);
return 1;
}