Jump to content
Geplaatst:
comment_1581611

Hallo,

ik heb Sandra's Rank system in me server zitten maar ik kan van deze cmds niet met het rank sys laten werken :S

gewone cmd:(niet getest)

dcmd_goto(playerid, params[])
{
new id,string[128],Float:X,Float:Y,Float:Z;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, RED, "USAGE: /GOTO [iD / NAME]");
if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, RED, "This player is offline or it is yourself");
SetPlayerInterior(playerid,GetPlayerInterior(id));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id)); GetPlayerPos(id,X,Y,Z);
if(IsPlayerInAnyVehicle(playerid))
{
	SetVehiclePos(GetPlayerVehicleID(playerid),X+2,Y,Z);
	SetVehicleVirtualWorld(playerid, 0);
	LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(id));
}
else SetPlayerPos(playerid,X+2,Y,Z);
format(string,sizeof(string),"You teleported to %s his location",Name(id)); SendClientMessage(playerid,YELLOW,string);
format(string,sizeof(string),"Admin: %s Teleported to your location",AdminName(playerid));
SendClientMessage(id,YELLOW,string);
return 1;
}

wat erbij moet als je met rank wil:

if(GetPlayerRank(playerid) >= 3)
{
//command
else
{
new pname[MAX_PLAYER_NAME], string1[256], string2[256];
GetPlayerName(playerid, pname, sizeof(pname));
format(string1, sizeof(string1), "Sorry, this command is only for players with rank 3 and higher.", pname);
GetPlayerName(playerid, pname, sizeof(pname));
format(string2, sizeof(string2), "Sorry, dit command is alleen voor spelers met rank 3 en hoger.", pname);
SendLanguageText(playerid, 0xFF0000AA,string1,string2);
}
return 1;
}

bij elkaar wat dus niet werkt :S

dcmd_goto(playerid, params[])
{
if(GetPlayerRank(playerid) >= 3) //4269
   {
new id,string[128],Float:X,Float:Y,Float:Z,plname[MAX_PLAYER_NAME];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /GOTO [iD / NAME]");
if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, RED, "This player is offline or it is yourself");
SetPlayerInterior(playerid,GetPlayerInterior(id));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id)); GetPlayerPos(id,X,Y,Z);
if(IsPlayerInAnyVehicle(playerid))
{
	SetVehiclePos(GetPlayerVehicleID(playerid),X+2,Y,Z);
	SetVehicleVirtualWorld(playerid, 0);
	LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(id));
}
else
SetPlayerPos(playerid,X+2,Y,Z);
GetPlayerName(playerid, plname, sizeof(plname));
format(string,sizeof(string),"Player: %s used /goto",plname);
SendClientMessage(id,COLOR_YELLOW,string);
else//4287
   {
   new pname[MAX_PLAYER_NAME], string1[256], string2[256];
   GetPlayerName(playerid, pname, sizeof(pname));
   format(string1, sizeof(string1), "Sorry, this command is only for players with rank 3 and higher.", pname);
   GetPlayerName(playerid, pname, sizeof(pname));
   format(string2, sizeof(string2), "Sorry, dit command is alleen voor spelers met rank 3 en hoger.", pname);
   SendLanguageText(playerid, 0xFF0000AA,string1,string2);
   }
   return 1;
}

(ik gebruik DCMD)

met bij elkaar zetten kreeg ik deze errors(heb boven neergezet welke lijn 4287 en 4269 is:

C:\Users\Rick\Desktop\SAMPSERVERR3\gamemodes\huidig.pwn(4287) : error 029: invalid expression, assumed zero

C:\Users\Rick\Desktop\SAMPSERVERR3\gamemodes\huidig.pwn(4342=einde script) : error 030: compound statement not closed at the end of file (started at line 4269)

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

Kan iemand me hiermee helpen ? alvast bedankt

~Shotyoudie

Bewerkt: door shotyoudie

Featured Replies

Geplaatst:
comment_1581615

Ik raad je aan om nog eens goed te gaan oefenen met de haakjes.

dcmd_goto(playerid, params[])
{
if(GetPlayerRank(playerid) >= 3) //4269
{
	new id,string[128],Float:X,Float:Y,Float:Z,plname[MAX_PLAYER_NAME];
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /GOTO [iD / NAME]");
	if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, RED, "This player is offline or it is yourself");
	SetPlayerInterior(playerid,GetPlayerInterior(id));
	SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id)); GetPlayerPos(id,X,Y,Z);
	if(IsPlayerInAnyVehicle(playerid))
	{
		SetVehiclePos(GetPlayerVehicleID(playerid),X+2,Y,Z);
		SetVehicleVirtualWorld(playerid, 0);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(id));
	}
	else
	{
		SetPlayerPos(playerid,X+2,Y,Z);
	}
	GetPlayerName(playerid, plname, sizeof(plname));
	format(string,sizeof(string),"Player: %s used /goto",plname);
	SendClientMessage(id,COLOR_YELLOW,string);
}
else//4287
{
	// Er word nergens naar een naam gevraagt in die zin, dus heb alle overbodige regels verwijderd.
	SendLanguageText(playerid, 0xFF0000AA, "Sorry, this command is only for players with rank 3 and higher.", "Sorry, dit command is alleen voor spelers met rank 3 en hoger.");
}
return 1;
}

Geplaatst:
  • Auteur
comment_1581628

Ik raad je aan om nog eens goed te gaan oefenen met de haakjes.

dcmd_goto(playerid, params[])
{
if(GetPlayerRank(playerid) >= 3) //4269
{
	new id,string[128],Float:X,Float:Y,Float:Z,plname[MAX_PLAYER_NAME];
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /GOTO [iD / NAME]");
	if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, RED, "This player is offline or it is yourself");
	SetPlayerInterior(playerid,GetPlayerInterior(id));
	SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id)); GetPlayerPos(id,X,Y,Z);
	if(IsPlayerInAnyVehicle(playerid))
	{
		SetVehiclePos(GetPlayerVehicleID(playerid),X+2,Y,Z);
		SetVehicleVirtualWorld(playerid, 0);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(id));
	}
	else
	{
		SetPlayerPos(playerid,X+2,Y,Z);
	}
	GetPlayerName(playerid, plname, sizeof(plname));
	format(string,sizeof(string),"Player: %s used /goto",plname);
	SendClientMessage(id,COLOR_YELLOW,string);
}
else//4287
{
	// Er word nergens naar een naam gevraagt in die zin, dus heb alle overbodige regels verwijderd.
	SendLanguageText(playerid, 0xFF0000AA, "Sorry, this command is only for players with rank 3 and higher.", "Sorry, dit command is alleen voor spelers met rank 3 en hoger.");
}
return 1;
}

hier heb ik weer dezelfde errors(

C:\Users\Rick\Desktop\SAMPSERVERR3\gamemodes\huidig.pwn(4332) : error 029: invalid expression, assumed zero

C:\Users\Rick\Desktop\SAMPSERVERR3\gamemodes\huidig.pwn(4385=einde script) : error 030: compound statement not closed at the end of file (started at line 4305)

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.)

dcmd_lock(playerid, params[])
{
       if(GetPlayerRank(playerid) >= 3)
       {
       if(IsPlayerInAnyVehicle(playerid))//4305
	{
	new State;
	State=GetPlayerState(playerid);
	if(State!=PLAYER_STATE_DRIVER)
	{
	SendClientMessage(playerid,COLOR_GREY,"You can only lock the doors as the driver.");
	return 1;
	}
	new i;
	for(i=0;i<MAX_PLAYERS;i++)
	{
	if(i != playerid)
	{
	SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
	}
	}
	new Float:X,Float:Y,Float:Z;
	SendClientMessage(playerid, COLOR_GREY, "Vehicle locked!");
	GetPlayerPos(playerid,X,Y,Z);
	PlayerPlaySound(playerid,1056,X,Y,Z);
	}
	else
	{
	SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle!");
	}
       {
       else//4332
       {
       new string1[256], string2[256];
       format(string1, sizeof(string1), "Sorry, this command is only for players with rank 3 and higher.");
       format(string2, sizeof(string2), "Sorry, dit command is alleen voor spelers met rank 3 en hoger.");
       SendLanguageText(playerid, 0xFF0000AA,string1,string2);
       }
       return 1;
}

ik snap gewoon niet wat ik nu fout doe ?

~Shotyoudie

Een reactie plaatsen

Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.

Gast
Op dit onderwerp reageren...

Recent actief 0

  • Er zijn hier geen geregistreerde gebruikers aanwezig.