Duel help, help me to finish it please -
BarFix - 19.11.2013
Hello guys, i want to make /duel command that tping you to some place and gives you shotgun and deagle.
I tried:
Код:
CMD:duel(playerid, params[])
{
new giveplayerid, playerb;
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
if(sscanf(params, "u", giveplayerid, playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /duel [playerid] [playerid]");
SetPlayerPos(giveplayerid, 1413.6411, -16.8837, 1000.9249);
SetPlayerVirtualWorld(giveplayerid, 1);
SetPlayerInterior(giveplayerid, 1);
PlayerInfo[giveplayerid][pInt] = 1;
PlayerInfo[giveplayerid][pVW] = 1;
SetPlayerPos(playerb, 1363.9401, -19.5196, 1000.9249);
SetPlayerVirtualWorld(playerb, 1);
SetPlayerInterior(playerb, 1);
PlayerInfo[playerb][pInt] = 1;
PlayerInfo[playerb][pVW] = 1;
GivePlayerValidWeapon(giveplayerid, 24, 99999);
GivePlayerValidWeapon(playerb, 24, 99999);
GivePlayerValidWeapon(giveplayerid, 25, 99999);
GivePlayerValidWeapon(playerb, 25, 99999);
return 1;
}
but that doesnt work, that tp only one player.
how do i create like:
First Player will get tp to: 1413.52, -21.24, 1000.92, 1
Second Player will get tp to: 1363.65, -21-83, 1000-92 1
that should to be like: /duel [id] [id]
Thanks guys!
Re: Duel help, help me to finish it please -
Lajko1 - 19.11.2013
pawn Код:
if(sscanf(params, "uu", giveplayerid, playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /duel [playerid] [playerid]");
You are using 2 params for 2 players so use 2x "uu"
Re: Duel help, help me to finish it please -
BarFix - 19.11.2013
Quote:
Originally Posted by Lajko1
pawn Код:
if(sscanf(params, "uu", giveplayerid, playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /duel [playerid] [playerid]");
You are using 2 params for 2 players so use 2x "uu"
|
Im not so good in pawn lol, can you help me where to put it?
Respuesta: Duel help, help me to finish it please -
CrossOv3r - 19.11.2013
pawn Код:
CMD:duel(playerid, params[])
{
new giveplayerid, playerb;
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
if(sscanf(params, "uu", giveplayerid, playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /duel [playerid] [playerid]");
SetPlayerPos(giveplayerid, 1413.6411, -16.8837, 1000.9249);
SetPlayerVirtualWorld(giveplayerid, 1);
SetPlayerInterior(giveplayerid, 1);
PlayerInfo[giveplayerid][pInt] = 1;
PlayerInfo[giveplayerid][pVW] = 1;
SetPlayerPos(playerb, 1363.9401, -19.5196, 1000.9249);
SetPlayerVirtualWorld(playerb, 1);
SetPlayerInterior(playerb, 1);
PlayerInfo[playerb][pInt] = 1;
PlayerInfo[playerb][pVW] = 1;
GivePlayerValidWeapon(giveplayerid, 24, 99999);
GivePlayerValidWeapon(playerb, 24, 99999);
GivePlayerValidWeapon(giveplayerid, 25, 99999);
GivePlayerValidWeapon(playerb, 25, 99999);
return 1;
}
Re: Duel help, help me to finish it please -
Lajko1 - 19.11.2013
Quote:
Originally Posted by BarFix
Im not so good in pawn lol, can you help me where to put it?
|
Use CrossOver's code, he put it in..
Re: Respuesta: Duel help, help me to finish it please -
BarFix - 19.11.2013
Quote:
Originally Posted by Lajko1
pawn Код:
if(sscanf(params, "uu", giveplayerid, playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /duel [playerid] [playerid]");
You are using 2 params for 2 players so use 2x "uu"
|
Quote:
Originally Posted by CrossOv3r
pawn Код:
CMD:duel(playerid, params[]) { new giveplayerid, playerb; if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty."); if(sscanf(params, "uu", giveplayerid, playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /duel [playerid] [playerid]"); SetPlayerPos(giveplayerid, 1413.6411, -16.8837, 1000.9249); SetPlayerVirtualWorld(giveplayerid, 1); SetPlayerInterior(giveplayerid, 1); PlayerInfo[giveplayerid][pInt] = 1; PlayerInfo[giveplayerid][pVW] = 1; SetPlayerPos(playerb, 1363.9401, -19.5196, 1000.9249); SetPlayerVirtualWorld(playerb, 1); SetPlayerInterior(playerb, 1); PlayerInfo[playerb][pInt] = 1; PlayerInfo[playerb][pVW] = 1; GivePlayerValidWeapon(giveplayerid, 24, 99999); GivePlayerValidWeapon(playerb, 24, 99999); GivePlayerValidWeapon(giveplayerid, 25, 99999); GivePlayerValidWeapon(playerb, 25, 99999); return 1; }
|
Thank you guys!
but if possible, how to do like, if you die in the duel then that auto revive you?
Re: Duel help, help me to finish it please -
Lajko1 - 19.11.2013
It is possible but I guess I'm not enough skilled to do that ^^