Hola Amigos de EspañolPawno Hoy les Traigo Un Tutorial de Como hacer un Simple Sistema de Cinturon y de Ventana [Muy Util para los Role-Play] Bueno Aqui esto es Simple , Aqui se los dejo en un Codigo Pawn
Cinturon:
Ventanilla:
Cinturon:
- Código:
//----------Sistema de Cinturon Por Alex_Sierra y Ben-----------//
if(strcmp(cmd,"/Cinturon",true)==0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
SendClientMessage(playerid,COLOR_GREY,"Lo Siento.. Debes Abordar un Vehiculo para Usar el Comando..");
return 1;
}
if(PlayerInfo[playerid][pCinturon] == 1)
{
PlayerInfo[playerid][pCinturon] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
new stringtosee[255];
new ftext[255];
if(PlayerInfo[playerid][pSex] == 1) { ftext = "El"; }
else if(PlayerInfo[playerid][pSex] == 1) { ftext = "Ella"; }
format(stringtosee, sizeof(stringtosee), "* %s Se Saca El Cinturón de Seguridad", sendername , ftext);
ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
return 1;
}
PlayerInfo[playerid][pCinturon] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
new stringtosee[255];
new ftext[255];
if(PlayerInfo[playerid][pSex] == 1) { ftext = "El"; }
else if(PlayerInfo[playerid][pSex] == 1) { ftext = "Ella"; }
format(stringtosee, sizeof(stringtosee), "* %s Se Pone el Cinturón de Seguridad", sendername , ftext);
ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
return 1;
Ventanilla:
- Código:
//------------Sistema de Ventana Por Alex_Sierra y Ben-----------------//
if(!strcmp(cmdtext, "/ventana", true) || !strcmp(cmdtext, "/ven", true)) //
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Tienes que Logearte para Usar este Comando ! ");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
new carid = GetPlayerVehicleID(playerid);
if(IsABike(carid) || IsAOBike(carid) || IsAPizzabike(carid) || IsAPlane(carid) || IsABoat(carid) || IsASweeper(carid) || IsAHarvest(carid) || IsADrugHarvest(carid) || IsATank(carid) || pveh == 523 || pveh == 480 || pveh == 567 || pveh == 533 || pveh == 555 || pveh == 539 || pveh == 572 || pveh == 571 || pveh == 530 || pveh == 457 || pveh == 575 || pveh == 536 || pveh == 424)
{
SendClientMessage(playerid, COLOR_GREY, " Este vehículo no tiene la ventana para Bajar");
return 1;
}
if(VehicleWindows[GetPlayerVehicleID(playerid)] == 0)
{
VehicleWindows[GetPlayerVehicleID(playerid)] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Bajo La ventanilla.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else if(VehicleWindows[GetPlayerVehicleID(playerid)] == 1)
{
VehicleWindows[GetPlayerVehicleID(playerid)] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Subio La ventanilla.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Usted necesita estar en el vehículo a utilizar este Comando !");
return 1;
}
}
return 1;
}