Compile error.
#1

FS:
Код:
#include <a_samp>

#define filterscript
#define COLOR_RED 0xFF0000AA
#define COPS 1
#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

new gTeam[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])

	{
	dcmd(jail, 4, cmdtext);
	}
	
	dcmd_jail(playerid, params[])
	{
  if(!IsPlayerLogged(playerid))
	return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not logged in!");
	
	if(gTeam[playerid] == COPS)
	return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a COP !");
	
	new time;
	if(sscanf(params, "id", giveplayerid, time))
	{
	SendClientMessage(playerid, COLOR_RED, "USAGE: /jail <id> <seconds>");
	return 1;
	}
	
	if(!IsPlayerConnected(giveplayerid))
	    return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid player ID!");
	
	time = time * 60000;
	
	if(pJailtime > 999999)
	{
	format(str, sizeof(str), "ERROR: exceeded maximum jail time limit (you tried %d seconds, but maximum is 999999)", time);
	SendClientMessage(playerid, COLOR_RED, str);
	return 1;
	}
	if(pJailtime < 0)
	{
	format(str, sizeof(str), "ERROR: exceeded minimum jail time limit (you tried %d seconds, but minimum is 0)", time);
	SendClientMessage(playerid, COLOR_RED, str);
	return 1;
	}

	GetPlayerPos(giveplayerid, POS_before_jail[giveplayerid][0], POS_before_jail[giveplayerid][1], POS_before_jail[giveplayerid][2]);
	INT_before_jail[giveplayerid] = GetPlayerInterior(giveplayerid);

	OnJail[playerid] = 1;
	pInfo[giveplayerid][pJailed] = 1;
	ResetPlayerWeapons(giveplayerid);
	SetPlayerArmour(giveplayerid, 0.0);
	// GivePlayerMoney(giveplayerid, -20);
	ResetPlayerWeapons(giveplayerid);
	new rand = random(sizeof(gRandomPlayerSpawns2));
	SetPlayerPos(giveplayerid, gRandomPlayerSpawns2[rand][0], gRandomPlayerSpawns2[rand][1], gRandomPlayerSpawns2[rand][2]);
	SetPlayerFacingAngle(giveplayerid, 98.0796);
	
	PlayerPlaySound(giveplayerid, 1002, 0.0, 0.0, 0.0);
	
	SetTimerEx("UnjailPlayer", pJailtime, false, "i", giveplayerid);
	SetTimer("JailTime", 1000, giveplayerid);
	GameTextForPlayer(giveplayerid, "~r~Busted!", 2000, 1);
	return 1;
	}
Error:
Код:
C:\Documents and Settings\User\Desktop\COPS.pwn(14) : warning 209: function "OnPlayerCommandText" should return a value
C:\Documents and Settings\User\Desktop\COPS.pwn(18) : error 017: undefined symbol "IsPlayerLogged"
C:\Documents and Settings\User\Desktop\COPS.pwn(25) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\User\Desktop\COPS.pwn(31) : error 017: undefined symbol "giveplayerid"
C:\Documents and Settings\User\Desktop\COPS.pwn(36) : error 017: undefined symbol "pJailtime"
C:\Documents and Settings\User\Desktop\COPS.pwn(38) : error 017: undefined symbol "str"
C:\Documents and Settings\User\Desktop\COPS.pwn(38) : error 017: undefined symbol "str"
C:\Documents and Settings\User\Desktop\COPS.pwn(38) : error 029: invalid expression, assumed zero
C:\Documents and Settings\User\Desktop\COPS.pwn(38) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#2

Pawn manual:
http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

Reply
#3

It would be simple if you pass me the correct code
Reply
#4

It would be even simpler if you learned some of the basics of scripting
Reply
#5

I don't know , THATS WHY I AM ASKING HELP !
Reply
#6

Yes, exactly, we are here to help, not to pass fixed codes for you.

Now, we're helping you by telling you to learn the basics, because if when you learn them you will find out what's wrong with your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)