1
Snippet Showroom / Sistema De Duelo
« on: October 10, 2014, 04:53:28 am »
[pawn]new duelo[MAX_PLAYERS];[/pawn]
en public OnPlayerDisconnect(playerid, reason)
[pawn]duelo[playerid] = 0;[/pawn]
[pawn]public OnPlayerCommandText(playerid, cmdtext[])
{
else if ( strcmp( cmd, "salirbatalla", true ) == 0 )
{
if(duelo[playerid] == 0) {
SendClientMessage(playerid,COLOR_RED,"Error: debes estar en batalla para salir de ella");
}
if(duelo[playerid] == 1) {
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "logueate primero" );
else
{
format( szMsg, 128, "%s a salido de batalla para salir pon /c salirbatalla",gPlayers[playerid] );
SendClientMessageToAll( BLUE, szMsg );
SetPlayerPos(playerid,-702.69311,337.37844,10.89598,0,0);
duelo[playerid] = 0;
}
}
return 1;
}
else if ( strcmp( cmd, "batalla", true ) == 0 )
{
if(duelo[playerid] == 1) {
SendClientMessage(playerid,COLOR_RED,"Error: ya estas en batalla");
}
if(duelo[playerid] == 0) {
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Logueate primero" );
else
{
format( szMsg, 128, "%s a entrado a la batalla para entrar escribe /c batalla",gPlayers[playerid] );
SendClientMessageToAll( BLUE, szMsg );
SetPlayerPos(playerid,-1246.70227,1406.93408,84.69406,0,0);
SetPlayerWeapon(playerid,27,10000);
SetPlayerWeapon(playerid,21,10000);
duelo[playerid] = 1;
}
}
return 1;
}[/pawn]
[pawn]public OnPlayerSpawn(playerid,classid,teamid)
{
if(duelo[playerid] == 1) {
SendClientMessage(playerid,COLOR_RED,"Apareces en batalla usa /c salirbatalla para salir de ella.");
SetPlayerPos(playerid,-1246.70227,1406.93408,84.69406,0,0);
}
if(duelo[playerid] == 0) {
SendClientMessage(playerid,COLOR_RED,"has salido de batalla");
}
return 1;
}[/pawn]
en public OnPlayerDisconnect(playerid, reason)
[pawn]duelo[playerid] = 0;[/pawn]
[pawn]public OnPlayerCommandText(playerid, cmdtext[])
{
else if ( strcmp( cmd, "salirbatalla", true ) == 0 )
{
if(duelo[playerid] == 0) {
SendClientMessage(playerid,COLOR_RED,"Error: debes estar en batalla para salir de ella");
}
if(duelo[playerid] == 1) {
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "logueate primero" );
else
{
format( szMsg, 128, "%s a salido de batalla para salir pon /c salirbatalla",gPlayers[playerid] );
SendClientMessageToAll( BLUE, szMsg );
SetPlayerPos(playerid,-702.69311,337.37844,10.89598,0,0);
duelo[playerid] = 0;
}
}
return 1;
}
else if ( strcmp( cmd, "batalla", true ) == 0 )
{
if(duelo[playerid] == 1) {
SendClientMessage(playerid,COLOR_RED,"Error: ya estas en batalla");
}
if(duelo[playerid] == 0) {
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Logueate primero" );
else
{
format( szMsg, 128, "%s a entrado a la batalla para entrar escribe /c batalla",gPlayers[playerid] );
SendClientMessageToAll( BLUE, szMsg );
SetPlayerPos(playerid,-1246.70227,1406.93408,84.69406,0,0);
SetPlayerWeapon(playerid,27,10000);
SetPlayerWeapon(playerid,21,10000);
duelo[playerid] = 1;
}
}
return 1;
}[/pawn]
[pawn]public OnPlayerSpawn(playerid,classid,teamid)
{
if(duelo[playerid] == 1) {
SendClientMessage(playerid,COLOR_RED,"Apareces en batalla usa /c salirbatalla para salir de ella.");
SetPlayerPos(playerid,-1246.70227,1406.93408,84.69406,0,0);
}
if(duelo[playerid] == 0) {
SendClientMessage(playerid,COLOR_RED,"has salido de batalla");
}
return 1;
}[/pawn]