Help With script
#1

Hello i need help with my script for open a door why dosnt my script work?

First Add

Код:
new lspdgate;
and than i made this
Код:
if(strcmp(cmd, "/lspddoor", true) == 0)//DPD
	{
	    if(!IsACop(playerid))
	    {
	        SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to access this gate.");
	        return 1;
		}
		else
		{
        	GetPlayerName(playerid, sendername, sizeof(sendername));
			new strGatePosition[256];
			strGatePosition = strtok(cmdtext, idx);
			if(!strlen(strGatePosition))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /lspddoor [open/close]");
				return 1;
			}
			if(strcmp(strGatePosition,"open",true) == 0)
			{
				MoveDynamicObject(lspdgate, 1495,247.880111, 72.445343, 1002.560546,0.0000,0.000000,180.000000);
				format(string, sizeof(string), "* Officer %s Opens the LSPD Door", sendername);
				ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				return 1;
			}
			else if(strcmp(strGatePosition,"close",true) == 0)
			{
				MoveDynamicObject(lspdgate, 1495,244.894638, 72.445343, 1002.560546,0.0000,0.000000,0.000000);
				format(string, sizeof(string), "* Officer %s Closes the LSPD Door", sendername);
				ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				return 1;
			}
			else
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Unknown command!");
			    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /lspddoor [open/close]");
			    return 1;
			}
		}
 	}
any1 now why i get errors in my gm?

Код:
C:\Users\Alex\Desktop\GM GTA\gamemodes\lslrp.pwn(22310) : warning 217: loose indentation
C:\Users\Alex\Desktop\GM GTA\gamemodes\lslrp.pwn(22329) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\GM GTA\gamemodes\lslrp.pwn(22329) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\GM GTA\gamemodes\lslrp.pwn(22329) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\GM GTA\gamemodes\lslrp.pwn(22336) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\GM GTA\gamemodes\lslrp.pwn(22336) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\GM GTA\gamemodes\lslrp.pwn(22336) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\GM GTA\gamemodes\lslrp.pwn(22350) : warning 217: loose indentation
I Tested It In Game And Resultate Was
/lspddoor open >>Officer Alex_slav Opens The Lspd Door
/lspddoor close >>Officer Alex_slav Closes The Lspd Door

and then i get error in my Consolle stands

Код:
MoveDynamicObject Expecting 5 parameters
Код:
MoveDynamicObject Expecting 5 parameters
Код:
MoveDynamicObject Expecting 5 parameters
Код:
MoveDynamicObject Expecting 5 parameters
Код:
MoveDynamicObject Expecting 5 parameters
and position on doors
Код:
Код:
 	CreateDynamicObject(1495,247.880111, 72.445343, 1002.560546,0.0000,0.000000,180.000000); //lspddoor1 3
 	CreateDynamicObject(1495,244.894638, 72.445343, 1002.560546,0.0000,0.000000,0.000000); //lspddoor2 4
help me solve please

the script i took it from was

Код:
    if(strcmp(cmd, "/dpd", true) == 0)//DPD
	{
	    if(!IsACop(playerid))
	    {
	        SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to access this gate.");
	        return 1;
		}
		else
		{
        	GetPlayerName(playerid, sendername, sizeof(sendername));
			new strGatePosition[256];
			strGatePosition = strtok(cmdtext, idx);
			if(!strlen(strGatePosition))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dpd [open/close]");
				return 1;
			}
			if(strcmp(strGatePosition,"open",true) == 0)
			{
				MoveDynamicObject(dpdgate, 1410.7500,415.9500,10.0000, 5);
				format(string, sizeof(string), "* Officer %s Opens the SAST Gate", sendername);
				ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				return 1;
			}
			else if(strcmp(strGatePosition,"close",true) == 0)
			{
				MoveDynamicObject(dpdgate, 1410.7500,415.9500,20.0000, 5);
				format(string, sizeof(string), "* Officer %s Closes the SAST gate", sendername);
				ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				return 1;
			}
			else
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Unknown command!");
			    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dpd [open/close]");
			    return 1;
			}
		}
 	}
i kinda understand that it has somthing to do with the position
like this is the SAST GATE wich working
Код:
(dpdgate, 1410.7500,415.9500,20.0000, 5);
and than the one i use
Код:
(lspdgate, 1495,244.894638, 72.445343,
Reply


Messages In This Thread
Help With script - by showarn - 03.02.2011, 14:34
Re: Help With script - by iJumbo - 03.02.2011, 14:35
Re: Help With script - by Steven Paul - 03.02.2011, 14:36
Re: Help With script - by JaTochNietDan - 03.02.2011, 14:37

Forum Jump:


Users browsing this thread: 2 Guest(s)