Posts: 1,047
Threads: 23
Joined: Jun 2009
Quote:
Originally Posted by Joe Staff
pawn Код:
dcmd_goto(playerid,params[]) { if(AccInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid)) { if(!strlen(params)) return SendClientMessage(playerid, LIGHTBLUE2, "Usage: /goto [PlayerID]") && SendClientMessage(playerid, orange, "Function: Will Go to specified player");
new player1; new string[128];
if(!IsNumeric(params)) player1 = ReturnPlayerID(params); else player1 = strval(params);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
if(NotAllowedGoto[player1] == 1) return SendClientMessage(playerid, red, "ERROR: This player is not allowing players to teleport to them");
//{ //Invalid brace SendCommandToAdmins(playerid,"Goto"); new Float:x, Float:y, Float:z; GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1)); SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
if(GetPlayerState(playerid) == 2) { SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z); LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1)); SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1)); } else SetPlayerPos(playerid,x+2,y,z);
format(string,sizeof(string),"|- You have Teleported to \"%s\" -|", pName(player1)); return SendClientMessage(playerid,BlueMsg,string); //This is end //} //Invalid brace return ErrorMessages(playerid, 4);//line 4727 //After the end } else return ErrorMessages(playerid, 1); }
Indenting your code properly showed where your problem is (near the end)
EDIT: Gamer_Z beat me to it.
|
Those breaces are not really incorrect (from programming perspective), this is totally valid programming, for example:
pawn Код:
dcmd_x(playerid,params[])
{
new a = 0;
{
new b = 1;
printf("%d%d",a,b);
//b gets destroyed
}
{
new b = 2;//no error, totally valid
printf("%d%d",a,b);
}
//prints:
//01
//02
printf("%d%d",a,b); //error, undefined symbol "b"
return 0
}