14.12.2012, 22:31
Entгo vocк deve entender como quero no JFS, tenta me ajudar ai entгo, fazer que os 2 players (que mando e que aceitou) vгo para a posiзгo:
pawn Код:
CMD:duel(playerid,params[])
{
new
string[150],
pDuel,
Float:vida[MAX_PLAYERS]
;
GetPlayerHealth(playerid,vida[playerid]);
if(!IsPlayerConnected(pDuel)) return SendClientMessage(playerid,red,"Player not conneted.");
if(sscanf(params,"d",pDuel)) return SendClientMessage(playerid,red,"USAGE: /duel [duel id]");
//if(GetPlayerTeam(pDuel) == GetPlayerTeam(playerid)) return SendClientMessage(playerid,red,"ERROR: Player is of your team");
if(NoDuelo[playerid] == true) return SendClientMessage(playerid,red,"ERROR: You are in duel");
if(NoDuelo[pDuel] == true) return SendClientMessage(playerid,red,"ERROR: This player are in duel");
if(DueloSendoUsado == 1) return SendClientMessage(playerid,red,"ERROR: One duel already happening");
//if(duelid == 0 || 11) return SendClientMessage(playerid,red,"ERROR: Duel styles is of 1 on 10!");
if(vida[playerid] <= 100 || vida[pDuel] <= 100)
{
format(string,sizeof(string),"%s invited you to a duel. want to accept?",Nome(playerid));
ShowPlayerDialog(pDuel,DIALOG_DUELOENVIADO,DIALOG_STYLE_MSGBOX,"Duel",string,"Yes","No");
}
else
{
SendClientMessage(playerid,red,"ERROR: Need of full health");
}
if(jogadoresnoduel==2){DueloSendoUsado = 1;}
return 1;
}
if(dialogid == DIALOG_DUELOENVIADO)
{
if(response)
{
new strarmas[250];
format(strarmas,sizeof(strarmas),"Sniper+Shotgun\nShotgun+Deagle\nSpas12+Deagle\nM4+Shotgun\nSawn+Tec9\nGranade\nSwanOff\nDeagle\nMotovs\nKnife");
ShowPlayerDialog(playerid,DIALOG_ARMASDUELO,DIALOG_STYLE_LIST,"Weapons",strarmas,"Select","Cancel");
}
if(!response)
{
SendClientMessage(playerid,red,"Duel cancelled");
}
}
if(dialogid == DIALOG_ARMASDUELO)
{
if(response)
{
switch(listitem)
{
case 0:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,34,9999);
GivePlayerWeapon(playerid,25,9999);
NoDuelo[playerid] = true;
}
case 1:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,25,9999);
NoDuelo[playerid] = true;
}
case 2:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,27,9999);
GivePlayerWeapon(playerid,24,9999);
NoDuelo[playerid] = true;
}
case 3:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,31,9999);
GivePlayerWeapon(playerid,24,9999);
NoDuelo[playerid] = true;
}
case 4:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,26,9999);
GivePlayerWeapon(playerid,32,9999);
NoDuelo[playerid] = true;
}
case 5:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,18,9999);
NoDuelo[playerid] = true;
}
case 6:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
GivePlayerWeapon(playerid,26,9999);
NoDuelo[playerid] = true;
}
case 7:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
GivePlayerWeapon(playerid,24,9999);
NoDuelo[playerid] = true;
}
case 8:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
GivePlayerWeapon(playerid,16,9999);
NoDuelo[playerid] = true;
}
case 9:
{
jogadoresnoduel ++;
SetPlayerPos(playerid,0.0,1.1,2.2);
SetPlayerVirtualWorld(playerid,254862318);
SetPlayerInterior(playerid,0);
SetPlayerArmour(playerid,100.0);
SetPlayerHealth(playerid,100.0);
GivePlayerWeapon(playerid,4,9999);
NoDuelo[playerid] = true;
}
}
}
}