Help in creating 1VS1
#1

Код:
line 8044:new 1vs1;
line 8045:CMD:1vs1(playerid, params[])
line 8046:{
line 8047:            #pragma unused params
line 8048:            if(1vs1[playerid] == 2) return SCM(playerid,COLOR_RED,"1 VS 1 Arena is Full");
line 8049:            if(PlayerDuelWatching[playerid] == 1) return SCM(playerid,COLOR_RED," You can't use this command while watching duel /leavewatch");
line 8050:            if(challenge[playerid] == 1)
line 8051:            {
line 8052:            SendClientMessage(playerid, COLOR_RED, " please use /leave to leave the challenge.");
line 8053:            }
line 8054:            else
line 8055:            {
line 8056:			SendClientMessage(playerid, 0x00FFFFAA, "You've been teleported to 1vs1 DM.");
line 8057:            GameTextForPlayer(playerid,"~W~Welcome to~N~~R~~H~1vs1 DM~W~!",2000,3);
line 8058:            SetPlayerPos(playerid, 1778.7545,-2291.1230,26.7960);
line 8059:            SetPlayerInterior(playerid, 0);
line 8060:            new string[256], pname[MAX_PLAYER_NAME];
line 8061:           GetPlayerName(playerid, pname, sizeof(pname));
line 8062:            format(string, sizeof(string), "%s has gone to 1vs1 DM. (/1vs1)", pname);
line 8063:            SendClientMessageToAll(COLOR_ORANGE, string);
line 8064:			1vs1 = ++;
line 8065:            SetPlayerInterior(playerid, 0);
line 8066:            }
line 8067:            return 1;
}
THIS CODE WON'T work i even knew when i was typing it but i think i might help other understand what i want
now can anyone help me make 1vs1. it has maximum of 2 players limit at one time if an player types /1vs1 he will be teleported there and now 1 space is left so when an other person types he will be teleported there now there are 2 players in there so it's full so when another player type /1vs1 it should return
Код:
SCM(playerid,COLOR_RED,"1 VS 1 Arena is Full");
with this error message
now i am pretty sure u will get what i mean and yeah the codes i gave i tried to compile it and got
Код:
(8044) : error 020: invalid symbol name ""
(8044) : error 010: invalid function or declaration
(8048) : error 029: invalid expression, assumed zero
(8048) : error 017: undefined symbol "vs1"
(8048) : warning 215: expression has no effect
(8048) : error 001: expected token: ";", but found "]"
(8048) : fatal error 107: too many error messages on one line
Reply
#2

First, why the hell do this?

pawn Код:
CMD:mycmd(playerid,params[])
{
    #pragma unused params
    // ...
If you can simply do

pawn Код:
CMD:mycmd(playerid)
Second, you can't create a var that starts with a number.

Always start with a letter. (The only symbol i know it's possible is @). Fixing this, the code should compile fine.
Reply
#3

Quote:
Originally Posted by AroseKhanNaizi
Посмотреть сообщение
THIS CODE WON'T work i even knew when i was typing it but i think i might help other understand what i want
now can anyone help me make 1vs1. it has maximum of 2 players limit at one time if an player types /1vs1 he will be teleported there and now 1 space is left so when an other person types he will be teleported there now there are 2 players in there so it's full so when another player type /1vs1 it should return
this won't do this anyone can join it then even more than2
Reply
#4

Use variables and conditions to fix this.
Reply
#5

can u help in it
Reply
#6

anyone
Reply
#7

In the script you have at the top new 1vs1; but in the command where it says the arena is full you use this.
pawn Код:
if(1vs1[playerid] == 2) return SCM(playerid,COLOR_RED,"1 VS 1 Arena is Full");
Where it should be this
pawn Код:
if(1vs1 == 2) return SCM(playerid,COLOR_RED,"1 VS 1 Arena is Full");
or you can do it like this
pawn Код:
if(1vs1 == 2) return SendClientMessage(playerid,COLOR_RED,"1 VS 1 Arena is Full");
Reply
#8

Quote:
Originally Posted by jueix
Посмотреть сообщение
In the script you have at the top new 1vs1; but in the command where it says the arena is full you use this.
pawn Код:
if(1vs1[playerid] == 2) return SCM(playerid,COLOR_RED,"1 VS 1 Arena is Full");
Where it should be this
pawn Код:
if(1vs1 == 2) return SCM(playerid,COLOR_RED,"1 VS 1 Arena is Full");
or you can do it like this
pawn Код:
if(1vs1 == 2) return SendClientMessage(playerid,COLOR_RED,"1 VS 1 Arena is Full");
Thanks and how to reduce one like if i make a cmd like leave it will -1 form 1vs1
Код:
1vs1 = --; or 
1vs1 = +-;
Reply
#9

pawn Код:
var --;
var -= 1;
var = var - 1;
Reply
#10

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
pawn Код:
var --;
var -= 1;
var = var - 1;
Can u explain it bit more with using 1vs1 instead of var coz i didn't get anything
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)