a small question
#8

oh!, i'm not sure if i'm aloud to post the code, i'm sorry if i seem a bit u know lol



if(strcmp(cmd, "/duelo", true) == 0)
{
new Comando[256];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
Comando = strtok(cmdtext, idx);

new gangcmd = 3;

if(!strlen(Comando))
{
SendClientMessage(playerid, COLOR_WHITE,"USA: /Duelo [Retar/Aceptar/Entrar].");
return 1;
}

if(strcmp(Comando, "retar", true) == 0) gangcmd = 1;
if(strcmp(Comando, "aceptar", true) == 0) gangcmd = 2;
if(gangcmd > 2)
{
SendClientMessage(playerid, COLOR_WHITE, "USA: /Duelo [Retar/Aceptar/Entrar].");
return 1;
}
if(gangcmd < 0)
{
SendClientMessage(playerid, COLOR_WHITE, "USA: /Duelo [Retar/Aceptar/Entrar].");
return 1;
}
if(gangcmd == 1)
{
new inv[256];
inv = strtok(cmdtext, idx);
new player2 = strval(inv);

if(!strlen(inv))
{
SendClientMessage(playerid, COLOR_WHITE, "USO: '/duelo [retar] [id].");
return 1;
}

if (!IsPlayerConnected(player2))
return SendClientMessage(playerid, COLOR_WHITE, "Ese jugador no esta conectado.");

if(player2 == playerid)
return SendClientMessage(playerid, COLOR_WHITE, "No puedes tener un duelo contigo mismo!");

if(DuelInfo[player2][Invitado] == 2)
return SendClientMessage(playerid, COLOR_WHITE, "Ese jugador ya esta en un duelo!");

format(string,sizeof(string),"Has invitado a %s (id:%d) para que tenga un duelo contigo, espera a que acepte tu invitacion.",playername(player2),(player2));
SendClientMessage(playerid,COLOR_WHITE, string);

format(string,sizeof(string),"Has sido invitado por %s (ID:%d) para tener un duelo.",playername(playerid),(playerid));
SendClientMessage(player2,COLOR_WHITE, string);
SendClientMessage(player2,COLOR_WHITE, "Usa /duelo aceptar [id] para aceptar el duelo");

DuelInfo[player2][Invitado] = 1;
DuelInfo[player2][InvitadoPor] = playerid;
return 1;
}
Reply


Messages In This Thread
a small question - by _diana_ - 09.06.2009, 12:10
Re: a small question - by dice7 - 09.06.2009, 12:19
Re: a small question - by _diana_ - 09.06.2009, 12:28
Re: a small question - by MPKaboose - 09.06.2009, 12:29
Re: a small question - by hansen111 - 09.06.2009, 12:30
Re: a small question - by MPKaboose - 09.06.2009, 12:32
Re: a small question - by hansen111 - 09.06.2009, 12:34
Re: a small question - by _diana_ - 09.06.2009, 12:35
Re: a small question - by MPKaboose - 09.06.2009, 12:36
Re: a small question - by hansen111 - 09.06.2009, 12:42

Forum Jump:


Users browsing this thread: 2 Guest(s)