Whats wrong?!?! (please help)
#1

I have tried to make /go command that teleports player to other player with /gos command that enables/disables players from teleporting to you!
Whats wrong in this?
Please help!
Thanks!!!


Код:
CMD:go(playerid, params[])
{
	new giveplayerid;
	if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE:/go(playerid) to teleport to that player");
	new Float:x;
	new Float:y;
	new Float:z;
(825)	if(goto[playerid][giveplayerid] == true
	{
		GetPlayerPos(giveplayerid, x,y,z);
		SetPlayerPos(playerid, x,y,z);
	}
	else if(goto[playerid][all] == false
	{
	    SendClientMessage(playerid, 0xFF0000FF, "That player disabled teleports to him!");
	}
	return 1;
}

CMD:gos(playerid, params[])
{
	new giveplayerid;
	if(sscanf(params, "i", giveplayerid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE:/gos to enable/disable players for teleporting to you!");
	if(goto[playerid][giveplayerid] == true
	{
	    SendClientMessage(playerid, 0xFF0000FF, "You have disabled player from teleporting to you!");
	    goto[playerid][giveplayerid] = false;
	}
	if(goto[playerid][giveplayerid] == false
	{
	    SendClientMessage(playerid, 0xFF0000FF, "You have enabled player from teleporting to you!");
	    goto[playerid][giveplayerid] = true;
	}
	return 1;
}
Errors:
Код:
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : error 029: invalid expression, assumed zero
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : error 029: invalid expression, assumed zero
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : warning 215: expression has no effect
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : error 001: expected token: ";", but found "]"
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : fatal error 107: too many error messages on one line
Reply
#2

if(goto[playerid][giveplayerid] == true)

ur missing ) <---
Reply
#3

Quote:

if(goto[playerid][giveplayerid] == true)

ur missing ) <---

I still have the errors:
Код:
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : error 029: invalid expression, assumed zero
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : error 029: invalid expression, assumed zero
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : warning 215: expression has no effect
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : error 001: expected token: ";", but found "]"
C:\Users\----\Desktop\Sa-Mp Server\gamemodes\Commands.pwn(825) : fatal error 107: too many error messages on one line
Reply
#4

Try
Код:
	new giveplayerid;
	if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE:/go(playerid) to teleport to that player");
	new Float:x;
	new Float:y;
	new Float:z;
(825)	if(goto[playerid][giveplayerid] == true);
	{
		GetPlayerPos(giveplayerid, x,y,z);
		SetPlayerPos(playerid, x,y,z);
	}
	else if(goto[playerid][all] == false
	{
	    SendClientMessage(playerid, 0xFF0000FF, "That player disabled teleports to him!");
	}
	return 1;
}

CMD:gos(playerid, params[])
{
	new giveplayerid;
	if(sscanf(params, "i", giveplayerid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE:/gos to enable/disable players for teleporting to you!");
	if(goto[playerid][giveplayerid] == true
	{
	    SendClientMessage(playerid, 0xFF0000FF, "You have disabled player from teleporting to you!");
	    goto[playerid][giveplayerid] = false;
	}
	if(goto[playerid][giveplayerid] == false
	{
	    SendClientMessage(playerid, 0xFF0000FF, "You have enabled player from teleporting to you!");
	    goto[playerid][giveplayerid] = true;
	}
	return 1;
}
I am on mobile sorry.
Reply
#5

Still have the errors!
Reply
#6

Код:
(825)	if(goto[playerid][giveplayerid] == true));
	{
		GetPlayerPos(giveplayerid, x,y,z);
		SetPlayerPos(playerid, x,y,z);
	}
	else if(goto[playerid][all] == false
	{
	    SendClientMessage(playerid, 0xFF0000FF, "That player disabled teleports to him!");
	}
	return 1;
}
Reply
#7

Same errors!!!!!!!!!!!!!!!!!!
please help me anyone!
Reply
#8

This gonna work I think.
Код:
Code:
(825)	if(goto[playerid][giveplayerid] == true );
	{
		GetPlayerPos(giveplayerid, x,y,z);
		SetPlayerPos(playerid, x,y,z);
	}
	else if(goto[playerid][all] == false );
	{
	    SendClientMessage(playerid, 0xFF0000FF, "That player disabled teleports to him!");
	}
	return 1;
}
Reply
#9

pawn Код:
if(goto[playerid][giveplayerid] == true);
    {
        GetPlayerPos(giveplayerid, x,y,z);
        SetPlayerPos(playerid, x,y,z);
    }
    else if(goto[playerid][all] == false);
    {
        SendClientMessage(playerid, 0xFF0000FF, "That player disabled teleports to him!");
    }
    return 1;
}
Reply
#10

Quote:
Originally Posted by Rabea
Посмотреть сообщение
pawn Код:
if(goto[playerid][giveplayerid] == true);
    {
        GetPlayerPos(giveplayerid, x,y,z);
        SetPlayerPos(playerid, x,y,z);
    }
    else if(goto[playerid][all] == false);
    {
        SendClientMessage(playerid, 0xFF0000FF, "That player disabled teleports to him!");
    }
    return 1;
}
Its same code as mine I guess.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)