Switch this code?
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(takeoff, 7, cmdtext);
	return 0;
}
dcmd_takeoff(playerid, params[])
{
Код:
	switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
	{
		case 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513:
		{
			new msg[128], name[24];
			GetPlayerName(playerid, name, sizeof (name));
			format(msg,sizeof(msg), "%s taking off", name);
			SendClientMessageToAll(0xEEEE00FF, msg);
		}
		default: SendClientMessage(playerid,0xEEEE00FF, "You are not in a plane, you cannot take off");
	}
}
Can you guys switch this code to strcmp? Because I'm getting 2 errors.
Код:
\Documents and Settings\salim\My Documents\PAWN\gamemodes\APH.pwn(157) : error 017: undefined symbol "dcmd"
E:\Documents and Settings\salim\My Documents\PAWN\gamemodes\APH.pwn(543) : warning 203: symbol is never used: "dcmd_takeoff"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

1. Have you defined dcmd
2. Make sure you put it like this

pawn Код:
dcmd_takeoff(playerid, params[])
{
return 1;
}
Reply
#3

This is the code i just gave you a second ago with the instruction to include the dcmd from samp wiki, why make another post?
http://forum.sa-mp.com/index.php?top...6560#msg886560
https://sampwiki.blast.hk/wiki/Dcmd#Define_line
aka:
Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
and as toran said you need to include return 1;
Reply
#4



I defied it already.
Reply
#5

if you defined it you wouldn't get this:
error 017: undefined symbol "dcmd"
Reply
#6

I put the define to the tippy top. Now there is a new error.
Код:
E:\Documents and Settings\salim\My Documents\PAWN\gamemodes\APH.pwn(542) : warning 203: symbol is never used: "dcmd_takeoff"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
This is the line
Код:
dcmd_takeoff(playerid, params[])
Reply
#7

Thats just a warning you can ignore, but if you want that go away you can use #pragma unused params

Reply
#8

Oh wait thats code i put for someone elses question, i see.
Still you can always post in the same topic
Reply
#9


Ok.
It's working but it sends the message "username is taking off" but it also sends you a "unkown command".
Reply
#10

Did you return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)