24.04.2013, 12:06
Meu GM Nгo tem sistema de academia e os players estгo pedindo , alguem poderia min ajuda a fazer 1 ?
if (strcmp(cmd, "/rv",true) == 0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] > 0){
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "{00FF00} %s (%d) respawnou", pname,playerid);
SendClientMessageToAll(tcadm, string);
for(new v; v<MAX_VEHICLES; v++) if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);
SendClientMessage(playerid, Verde, "(INFO) Veiculos Respawnados");
proximocarro = 0;
for(new carro = 0; carro < MAX_CARROS; carro++)
{
format(string, sizeof(string), "carro%d.ini", carro);
if(dini_Exists(string)){
new carroid;
DestroyVehicle(dini_Int(string, "Id"));
carroid = AddStaticVehicle(dini_Int(string, "Modelo"), dini_Float(string, "CordX"), dini_Float(string, "CordY"), dini_Float(string, "CordZ"), dini_Float(string, "Angulo"), dini_Int(string, "Cor1"), dini_Int(string, "Cor2"));
dini_IntSet(string, "Id", carroid);
proximocarro++;
}
}
return 1;
}
}
IsVehicleOccupied(vid)
{
for(new i; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(GetPlayerVehicleID(i) == vid) return true;
}
return false;
}
if(strcmp(cmd, "/rv", true) == 0)
{
new ptname[MAX_PLAYER_NAME];
GetPlayerName(playerid, ptname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, ptname);
if(pAdmin[playerid] > 0)
{
for(new v = 0; v < MAX_VEHICLES; v++)
{
if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);
}
SendClientMessage(playerid, Verde, "Veнculos desocupados respawnados!");
format(string, sizeof(string), "O(A) ADM %s (%d) respawnou todos os veнculos desocupados.", ptname, playerid);
SendClientMessageToAll(tcadm, string);
}
return 1;
}
stock IsVehicleOccupied(vid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER || GetPlayerState(i) == PLAYER_STATE_PASSENGER)
{
if(GetPlayerVehicleID(i) == vid)
{
return 1;
}
}
}
}
return 0;
}
#include <a_samp>
new Menu:sistemadeluta;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Estilo de LUTA!");
print("--------------------------------------\n");
sistemadeluta = CreateMenu("Sistema de Luta", 1, 50.0, 180.0, 200.0, 200.0);
AddMenuItem(sistemadeluta, 0, "Luta ~~> Boxe");
AddMenuItem(sistemadeluta, 0, "Luta ~~> Kongfu");
AddMenuItem(sistemadeluta, 0, "Luta ~~> Briga de Rua");
AddMenuItem(sistemadeluta, 0, "Luta ~~> Agarra e Chute");
AddMenuItem(sistemadeluta, 0, "Luta ~~> Normal");
AddMenuItem(sistemadeluta, 0, "Sair / Fechar");
return 1;
}
//=============----- Comando -----============//
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mudarluta", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(sistemadeluta, playerid);
TogglePlayerControllable(playerid,0);
return 1;
}
return 0;
}
//=============----- Funзхes -----============//
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == sistemadeluta)
{
switch(row)
{
case 0:{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
}
case 1:{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
}
case 2:{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
}
case 3:{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
}
case 4:{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
}
case 5:{
SendClientMessage(playerid, 0x00ff00ff, " Vocк fechou o Menu Luta ");
}
}
}
return 1;
}