[Help] I need help with the script
#1

I want something in my script that can improve it. I need to have the time between the screen from number 3 back to zero and it will appear what I am looking for. And it will automatically open the port when the password has been found.
Please help me . I started to learn the script. Sorry my language is not good.
This is my scenario.
Код:
CMD:ffind(playerid, params[])
	{
	    if(PlayerInfo[playerid][pDuty] && IsACop(playerid))
	{
		//SendClientMessageEx(playerid, COLOR_RED, "* Listing all gates within 5 meters of you...");
		for(new i, Float: fGatePos[3], gateid, string[128], szMessage[32]; i < MAX_GATES; i++)
		{
			if(sscanf(params, "i", gateid))
			GetDynamicObjectPos(GateInfo[i][gGATE], fGatePos[0], fGatePos[1], fGatePos[2]);
			if(IsPlayerInRangeOfPoint(playerid, 5, fGatePos[0], fGatePos[1], fGatePos[2]))
			{
				if(GateInfo[i][gModel] != 0)
				{
			    	format(szMessage, sizeof(szMessage), "Gate ID %d (VW: %d)", i, GateInfo[i][gVW]);
			    	SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
			    	format(string,sizeof(string),"|___________ Password Gate (ID: %d) ___________|", gateid);
			    	format(string, sizeof(string), "PassWord Gate: %s", GateInfo[i][gPass]);
		            SendClientMessageEx(playerid, COLOR_WHITE, string);

				}
			}
		}
	}
	else
	{
	    SendClientMessageEx(playerid, COLOR_GRAD2, "Ban khong phai la nhan vien nha nuoc.");
	}
	return 1;
}
Reply
#2

i really don't understand what you want, but here is an improved verison of your script:
PHP код:
CMD:ffind(playeridparams[]){
    if(
PlayerInfo[playerid][pDuty] == || !IsACop(playerid)) return SendClientMessageEx(playeridCOLOR_GRAD2"Ban khong phai la nhan vien nha nuoc.");
    {
        
SendClientMessageEx(playeridCOLOR_RED"* Listing all gates within 5 meters of you...");
        new 
string[128], szMessage[32], Float:fGatePos[3];
        for(new 
iMAX_GATESi++){
            
GetDynamicObjectPos(GateInfo[i][gGATE], fGatePos[0], fGatePos[1], fGatePos[2]);
            if(
IsPlayerInRangeOfPoint(playerid5fGatePos[0], fGatePos[1], fGatePos[2]))
            {
                if(
GateInfo[i][gModel] != 0)
                {
                    
format(szMessagesizeof(szMessage), "Gate ID %d (VW: %d)"iGateInfo[i][gVW]);
                    
SendClientMessageEx(playeridCOLOR_WHITEszMessage);
                    
format(string,sizeof(string),"|___________ Password Gate (ID: %d) ___________|"i);
                
SendClientMessageEx(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), "PassWord Gate: %s"GateInfo[i][gPass]);
                    
SendClientMessageEx(playeridCOLOR_WHITEstring);
                }
            }
        }
    }
    return 
1;

i removed that gateid think. your command dosen't require sscanf. i also created the variabiles string[128], szMessage[32], Float:fGatePos[3] before the loop, it didn't make any sense defining them repeatedly
Reply
#3

But it is not really what I want. I want when I enter [/ ffind] it will appear [port ID] [password: ?]
and the gas has [Password] it will automatically open the gate. Currently my server uses the command to open port [/ movegate pawssword].
And I need a good one for it, or I want it to have time like server maintenance and it has a time point in the middle of the screen.
Reply
#4

Explain, I don't understand anything you ask.

Edit: When using the command tell you this: "/ ffind [port ID] [password]"?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)