SA-MP Forums Archive
Hello - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hello (/showthread.php?tid=584423)



Hello - Mariciuc223 - 04.08.2015

What it's wrong there

Код HTML:
CMD:gotocar(playerid, params[])
{
	new carid, vid, Float:vPos[3][MAX_VEHICLES];
	
	if((pInfo[playerid][pAdmin] < 4) && (pInfo[playerid][pHelper] < 4)) return SendClientMessage(playerid, FactColor[10], "You are not authorized to use that command !");
	if(sscanf(params, "i", carid)) return SendClientMessage(playerid, FactColor[11], "USAGE: /gotocar [CarID]");
	
	vid = GetPlayerVehicleID(playerid);
	GetVehiclePos(carid, vPos[0][carid], vPos[1][carid], vPos[2][carid]);
	
	if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(vid, vPos[0][carid]+3.0, vPos[1][carid]+3.0, vPos[2][carid]+0.5);
	else SetPlayerPos(vid, vPos[0][carid], vPos[1][carid], vPos[2][carid] + 2.5);
	
	SendClientMessage(playerid, FactColor[11], "You successfully performed that command !");
	return 1;
}
It give me unknown command ...


Re: Hello - Roberto80 - 04.08.2015

Lol everything is wrong
Код:
CMD:gotocar(playerid, params[])
{
	new carid, vid, Float:vPos[4];
	
	if(pInfo[playerid][pAdmin] < 4) || pInfo[playerid][pHelper] < 4)) return SendClientMessage(playerid, FactColor[10], "You are not authorized to use that command !");
	if(sscanf(params, "i", carid)) return SendClientMessage(playerid, FactColor[11], "USAGE: /gotocar [CarID]");
	vid = GetPlayerVehicleID(playerid);
	GetVehiclePos(carid, vPos[0], vPos[1], vPos[2]);
	
	if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(vid, vPos[0][carid]+3.0, vPos[1][carid]+3.0, vPos[2][carid]+0.5);
	else SetPlayerPos(playerid, vPos[0], vPos[1], vPos[2] + 2.5);
	
	SendClientMessage(playerid, FactColor[11], "You successfully performed that command !");
	return 1;
}



Re: Hello - Mariciuc223 - 04.08.2015

Quote:
Originally Posted by Roberto80
Посмотреть сообщение
Lol everything is wrong
Код:
CMD:gotocar(playerid, params[])
{
	new carid, vid, Float:vPos[4];
	
	if(pInfo[playerid][pAdmin] < 4) || pInfo[playerid][pHelper] < 4)) return SendClientMessage(playerid, FactColor[10], "You are not authorized to use that command !");
	if(sscanf(params, "i", carid)) return SendClientMessage(playerid, FactColor[11], "USAGE: /gotocar [CarID]");
	vid = GetPlayerVehicleID(playerid);
	GetVehiclePos(carid, vPos[0], vPos[1], vPos[2]);
	
	if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(vid, vPos[0][carid]+3.0, vPos[1][carid]+3.0, vPos[2][carid]+0.5);
	else SetPlayerPos(playerid, vPos[0], vPos[1], vPos[2] + 2.5);
	
	SendClientMessage(playerid, FactColor[11], "You successfully performed that command !");
	return 1;
}
Why the string have 4 dimensions ? ?

And there , mister "wrong" , you done the wrong thing ...

Код HTML:
if(pInfo[playerid][pAdmin] < 4) || pInfo[playerid][pHelper] < 4))
if player has admin or helper littlest 4 ?

Correct it's if player has admin level littlest 4 AND the helper level too [Perfect script , ha] - Anyway trying it right now.

EDIT: It's working , so there it's your +REP (the problem was there : Float:vPos[3][MAX_VEHICLES] ... Lol )


Re: Hello - Roberto80 - 04.08.2015

Quote:
Originally Posted by Mariciuc223
Посмотреть сообщение
Why the string have 4 dimensions ? ?

And there , mister "wrong" , you done the wrong thing ...

Код HTML:
if(pInfo[playerid][pAdmin] < 4) || pInfo[playerid][pHelper] < 4))
if player has admin or helper littlest 4 ?

Correct it's if player has admin level littlest 4 AND the helper level too [Perfect script , ha] - Anyway trying it right now.

EDIT: It's working , so there it's your +REP (the problem was there : Float:vPos[3][MAX_VEHICLES] ... Lol )
Oops my fault about "||" and "&&" excuse me x)
And u added more "( )" for nothing