[HELP] Compile Error [FIXED]
#1

Hey I am making my own gamemode, but I am getting 5 errors help me.

Код:
C:\Documents and Settings\User\Desktop\SAURP\GM.pwn(47) : error 001: expected token: ";", but found "new"
C:\Documents and Settings\User\Desktop\SAURP\GM.pwn(68) : error 017: undefined symbol "String"
C:\Documents and Settings\User\Desktop\SAURP\GM.pwn(68) : error 017: undefined symbol "String"
C:\Documents and Settings\User\Desktop\SAURP\GM.pwn(68) : error 036: empty statement
C:\Documents and Settings\User\Desktop\SAURP\GM.pwn(68) : fatal error 107: too many error messages on one line

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


5 Errors.
My Gamemode :

Код:
#include <a_samp>
#include <xClient>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_DARK_RED 0xAA3333AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x0000AA20
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define MAX_SPAM 6

new SpamStrings[MAX_PLAYERS];

main()
{
	print("\n----------------------------------");
	print(" ~ Ultimate Clean GM by Hot ~");
	print("----------------------------------\n");
}

public OnGameModeInit()
{
	SetGameModeText("Stunt•Freeroam•DM•Fun");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
  SendClientMessage(playerid, COLOR_GREEN, "Welcome San Andreas Stunters, Have fun!")
	new pName[MAX_PLAYER_NAME];
	new string[128];
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "%s has joined the server.", pName);
  SendClientMessageToAll(COLOR_GREY, string);

	if(!strcmp("[ViP]Labrik",pName,true) || !strcmp("netzeek",pName,true) || !strcmp("[MT]Lavis",pName,true))
	{
	  new kstring[128];
	  format(kstring, sizeof(kstring), "%s was auto kicked from the server (illegal name).", pName);
  	SendClientMessageToAll(COLOR_GREY, kstring);
  	print(kstring);
		Kick(playerid);
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	switch(reason)
  {
  case 0: format(String, sizeof(String), "%s lost connection to the server. (timeout)", PName);
  case 1: format(String, sizeof(String), "%s has left the server.", PName);
  case 2: format(String, sizeof(String), "%s has left the server. (kicked)", PName);
  }
	return 1;
}

public OnPlayerSpawn(playerid)
{
  SetPlayerHealth(playerid, 100);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
  FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
 	GameTextForPlayer(playerid,"~w~OMG, CALL THE AMBULANCE!",1000,1);
  SendDeathMessage(killerid, playerid, reason);
  GameTextForPlayer(killerid,"~r~You Murderer!",4000,3);
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	SpamStrings[playerid] ++;
	if(SpamStrings[playerid] >= MAX_SPAM)
	{
	  new PlayerName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
		printf("(previous text of %s was blocked by antispam)", PlayerName);
		SendClientMessage(playerid,0xCC0000AA,"Please wait 20 seconds before you spam again (spam protection).");
		return 0;
	}
  new textstring[128];
  format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
  SendPlayerMessageToAll(playerid, textstring);
	return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/parachute", true) == 0)
	{
		GivePlayerWeapon(playerid, 46, 1);
		SendClientMessage(playerid,COLOR_GREEN,"Use it well!");
		PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
		return 1;
	}
		if (strcmp(cmdtext, "/flip", true)==0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
		new Float:PX, Float:PY, Float:PZ, Float:PA;
		GetPlayerPos(playerid, PX, PY, PZ);
		GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
			SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
		SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
		SendClientMessage(playerid, COLOR_BASIC,"Vehicle Fliped!");
		PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
		}
		else
		{
		SendClientMessage(playerid, COLOR_RED,"Cn you flip your self?");
		}
		return 1;
	}
	
		if (strcmp(cmdtext, "/lock", true)==0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			new State=GetPlayerState(playerid);
			if(State!=PLAYER_STATE_DRIVER)
			{
				SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
				return 1;
			}
			new i;
			for(i=0;i<MAX_PLAYERS;i++)
			{
				if(i != playerid)
				{
					SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
				}
			}
			SendClientMessage(playerid, COLOR_BASIC, "Vehicle locked!");
	  	new Float:pX, Float:pY, Float:pZ;
			GetPlayerPos(playerid,pX,pY,pZ);
			PlayerPlaySound(playerid,1056,pX,pY,pZ);
			PlayerPlaySound(playerid, 1137,pX,pY,pZ);
			locked[playerid][GetPlayerVehicleID(playerid)] = 1;
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
		}
		return 1;
	}

	if (strcmp(cmdtext, "/unlock", true)==0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			new State=GetPlayerState(playerid);
			if(State!=PLAYER_STATE_DRIVER)
			{
				SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
				return 1;
			}
			new i;
			for(i=0;i<MAX_PLAYERS;i++)
			{
				SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
			}
			SendClientMessage(playerid, COLOR_BASIC, "Vehicle unlocked!");
			new Float:pX, Float:pY, Float:pZ;
			GetPlayerPos(playerid,pX,pY,pZ);
			PlayerPlaySound(playerid, 1058,pX,pY,pZ);
			locked[playerid][GetPlayerVehicleID(playerid)] = 0;
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
		}
		return 1;
	}
	  if (strcmp(cmdtext, "/savep", true)==0)
  {
    GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
    GetPlayerFacingAngle(playerid, PosA[playerid]);
		SendClientMessage(playerid, COLOR_BASIC, "Positon set! Go to this possiton with /loadp");
    PosI[playerid] = (GetPlayerInterior(playerid));
    PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
		return 1;
		}
		
		  if (strcmp(cmdtext, "/loadp", true)==0)
  {
    if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
    {
      return SendClientMessage(playerid, COLOR_RED, "Use /savep first!");
		}
		else
		{
			ResetPlayerWeapons(playerid);
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
	      SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
	      SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
	      SetCameraBehindPlayer(playerid);
	      LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
	    }
	    else
	    {
				InCar[playerid] = false;
		    SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
		    SetPlayerFacingAngle(playerid, PosA[playerid]);
				SetCameraBehindPlayer(playerid);
			}
			PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
			SetPlayerInterior(playerid, PosI[playerid]);
			SendClientMessage(playerid, COLOR_BASIC, "Position Loaded");
		}
		return 1;
  }
	return 0;
}
Line with errors :

Код:
(47)new pName[MAX_PLAYER_NAME];
(68)case 0: format(String, sizeof(String), "%s lost connection to the server. (timeout)", PName);
Reply
#2

I also fixed your indentitation but the forum fucks it up a bit.
pawn Код:
#include <a_samp>
#include <xClient>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_DARK_RED 0xAA3333AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x0000AA20
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define MAX_SPAM 6

new SpamStrings[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" ~ Ultimate Clean GM by Hot ~");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Stunt•Freeroam•DM•Fun");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, COLOR_GREEN, "Welcome San Andreas Stunters, Have fun!");
    new pName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s has joined the server.", pName);
    SendClientMessageToAll(COLOR_GREY, string);

    if(!strcmp("[ViP]Labrik",pName,true) || !strcmp("netzeek",pName,true) || !strcmp("[MT]Lavis",pName,true))
    {
      new kstring[128];
      format(kstring, sizeof(kstring), "%s was auto kicked from the server (illegal name).", pName);
    SendClientMessageToAll(COLOR_GREY, kstring);
    print(kstring);
        Kick(playerid);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    switch(reason)
    {
        case 0: format(String, sizeof(String), "%s lost connection to the server. (timeout)", PName);
        case 1: format(String, sizeof(String), "%s has left the server.", PName);
        case 2: format(String, sizeof(String), "%s has left the server. (kicked)", PName);
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid, 100);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
    GameTextForPlayer(playerid,"~w~OMG, CALL THE AMBULANCE!",1000,1);
    SendDeathMessage(killerid, playerid, reason);
    GameTextForPlayer(killerid,"~r~You Murderer!",4000,3);
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    SpamStrings[playerid] ++;
    if(SpamStrings[playerid] >= MAX_SPAM)
    {
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
        printf("(previous text of %s was blocked by antispam)", PlayerName);
        SendClientMessage(playerid,0xCC0000AA,"Please wait 20 seconds before you spam again (spam protection).");
        return 0;
    }
    new textstring[128];
    format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
    SendPlayerMessageToAll(playerid, textstring);
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/parachute", true) == 0)
    {
        GivePlayerWeapon(playerid, 46, 1);
        SendClientMessage(playerid,COLOR_GREEN,"Use it well!");
        PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
        return 1;
    }
    if (strcmp(cmdtext, "/flip", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:PX, Float:PY, Float:PZ, Float:PA;
            GetPlayerPos(playerid, PX, PY, PZ);
            GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
            SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SendClientMessage(playerid, COLOR_BASIC,"Vehicle Fliped!");
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED,"Cn you flip your self?");
        }
        return 1;
    }
   
    if (strcmp(cmdtext, "/lock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                if(i != playerid)
                {
                    SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                }
            }
            SendClientMessage(playerid, COLOR_BASIC, "Vehicle locked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1056,pX,pY,pZ);
            PlayerPlaySound(playerid, 1137,pX,pY,pZ);
            locked[playerid][GetPlayerVehicleID(playerid)] = 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
        }
        return 1;
    }

    if (strcmp(cmdtext, "/unlock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
            }
            SendClientMessage(playerid, COLOR_BASIC, "Vehicle unlocked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid, 1058,pX,pY,pZ);
            locked[playerid][GetPlayerVehicleID(playerid)] = 0;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
        }
        return 1;
    }
    if (strcmp(cmdtext, "/savep", true)==0)
    {
        GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
        GetPlayerFacingAngle(playerid, PosA[playerid]);
        SendClientMessage(playerid, COLOR_BASIC, "Positon set! Go to this possiton with /loadp");
        PosI[playerid] = (GetPlayerInterior(playerid));
        PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
        return 1;
    }
       
    if (strcmp(cmdtext, "/loadp", true)==0)
    {
        if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
        {
            return SendClientMessage(playerid, COLOR_RED, "Use /savep first!");
        }
        else
        {
            ResetPlayerWeapons(playerid);
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
                SetCameraBehindPlayer(playerid);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
            }
            else
            {
                InCar[playerid] = false;
                SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
                SetPlayerFacingAngle(playerid, PosA[playerid]);
                SetCameraBehindPlayer(playerid);
            }
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
            SetPlayerInterior(playerid, PosI[playerid]);
            SendClientMessage(playerid, COLOR_BASIC, "Position Loaded");
        }
        return 1;
  }
    return 0;
}

Reply
#3

NOW THESE ERRORS :

Код:
C:\Documents and Settings\User\Desktop\GM.pwn(47) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(50) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(53) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(59) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(68) : error 017: undefined symbol "String"
C:\Documents and Settings\User\Desktop\GM.pwn(68) : error 017: undefined symbol "String"
C:\Documents and Settings\User\Desktop\GM.pwn(68) : error 036: empty statement
C:\Documents and Settings\User\Desktop\GM.pwn(68) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#4

pawn Код:
#include <a_samp>
#include <xClient>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_DARK_RED 0xAA3333AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x0000AA20
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define MAX_SPAM 6

new SpamStrings[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" ~ Ultimate Clean GM by Hot ~");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Stunt•Freeroam•DM•Fun");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, COLOR_GREEN, "Welcome San Andreas Stunters, Have fun!");
    new pName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s has joined the server.", pName);
    SendClientMessageToAll(COLOR_GREY, string);

    if(!strcmp("[ViP]Labrik",pName,true) || !strcmp("netzeek",pName,true) || !strcmp("[MT]Lavis",pName,true))
    {
      new kstring[128];
      format(kstring, sizeof(kstring), "%s was auto kicked from the server (illegal name).", pName);
    SendClientMessageToAll(COLOR_GREY, kstring);
    print(kstring);
        Kick(playerid);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new String[ 80 ];
    switch(reason)
    {
        case 0: format(String, sizeof(String), "%s lost connection to the server. (timeout)", PName);
        case 1: format(String, sizeof(String), "%s has left the server.", PName);
        case 2: format(String, sizeof(String), "%s has left the server. (kicked)", PName);
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid, 100);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
    GameTextForPlayer(playerid,"~w~OMG, CALL THE AMBULANCE!",1000,1);
    SendDeathMessage(killerid, playerid, reason);
    GameTextForPlayer(killerid,"~r~You Murderer!",4000,3);
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    SpamStrings[playerid] ++;
    if(SpamStrings[playerid] >= MAX_SPAM)
    {
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
        printf("(previous text of %s was blocked by antispam)", PlayerName);
        SendClientMessage(playerid,0xCC0000AA,"Please wait 20 seconds before you spam again (spam protection).");
        return 0;
    }
    new textstring[128];
    format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
    SendPlayerMessageToAll(playerid, textstring);
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/parachute", true) == 0)
    {
        GivePlayerWeapon(playerid, 46, 1);
        SendClientMessage(playerid,COLOR_GREEN,"Use it well!");
        PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
        return 1;
    }
    if (strcmp(cmdtext, "/flip", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:PX, Float:PY, Float:PZ, Float:PA;
            GetPlayerPos(playerid, PX, PY, PZ);
            GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
            SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SendClientMessage(playerid, COLOR_BASIC,"Vehicle Fliped!");
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED,"Cn you flip your self?");
        }
        return 1;
    }
   
    if (strcmp(cmdtext, "/lock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                if(i != playerid)
                {
                    SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                }
            }
            SendClientMessage(playerid, COLOR_BASIC, "Vehicle locked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1056,pX,pY,pZ);
            PlayerPlaySound(playerid, 1137,pX,pY,pZ);
            locked[playerid][GetPlayerVehicleID(playerid)] = 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
        }
        return 1;
    }

    if (strcmp(cmdtext, "/unlock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
            }
            SendClientMessage(playerid, COLOR_BASIC, "Vehicle unlocked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid, 1058,pX,pY,pZ);
            locked[playerid][GetPlayerVehicleID(playerid)] = 0;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
        }
        return 1;
    }
    if (strcmp(cmdtext, "/savep", true)==0)
    {
        GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
        GetPlayerFacingAngle(playerid, PosA[playerid]);
        SendClientMessage(playerid, COLOR_BASIC, "Positon set! Go to this possiton with /loadp");
        PosI[playerid] = (GetPlayerInterior(playerid));
        PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
        return 1;
    }
       
    if (strcmp(cmdtext, "/loadp", true)==0)
    {
        if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
        {
            return SendClientMessage(playerid, COLOR_RED, "Use /savep first!");
        }
        else
        {
            ResetPlayerWeapons(playerid);
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
                SetCameraBehindPlayer(playerid);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
            }
            else
            {
                InCar[playerid] = false;
                SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
                SetPlayerFacingAngle(playerid, PosA[playerid]);
                SetCameraBehindPlayer(playerid);
            }
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
            SetPlayerInterior(playerid, PosI[playerid]);
            SendClientMessage(playerid, COLOR_BASIC, "Position Loaded");
        }
        return 1;
  }
    return 0;
}

The warnings are because of the indentitation. Just fix it by putting some tabs here and there around the lines. There's a great topic about it.
Reply
#5

OMG 10 erros :O !

Код:
C:\Documents and Settings\User\Desktop\GM.pwn(47) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(50) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(53) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(59) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(69) : error 017: undefined symbol "PName"
C:\Documents and Settings\User\Desktop\GM.pwn(70) : error 017: undefined symbol "PName"
C:\Documents and Settings\User\Desktop\GM.pwn(71) : error 017: undefined symbol "PName"
C:\Documents and Settings\User\Desktop\GM.pwn(79) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(84) : error 017: undefined symbol "FadePlayerScreen"
C:\Documents and Settings\User\Desktop\GM.pwn(85) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(86) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(88) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(102) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(107) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(110) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(131) : error 017: undefined symbol "COLOR_BASIC"
C:\Documents and Settings\User\Desktop\GM.pwn(159) : error 017: undefined symbol "COLOR_BASIC"
C:\Documents and Settings\User\Desktop\GM.pwn(160) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(161) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(164) : error 017: undefined symbol "locked"
C:\Documents and Settings\User\Desktop\GM.pwn(164) : warning 215: expression has no effect
C:\Documents and Settings\User\Desktop\GM.pwn(164) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\User\Desktop\GM.pwn(164) : error 029: invalid expression, assumed zero
C:\Documents and Settings\User\Desktop\GM.pwn(164) : fatal error 107: too many error messages on one line

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


10 Errors.
Reply
#6

Here, but you don't have FadePlayerScreen, search for it on the forums.
pawn Код:
#include <a_samp>
#include <xClient>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_DARK_RED 0xAA3333AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x0000AA20
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define MAX_SPAM 6

new SpamStrings[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" ~ Ultimate Clean GM by Hot ~");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Stunt•Freeroam•DM•Fun");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, COLOR_GREEN, "Welcome San Andreas Stunters, Have fun!");
    new pName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s has joined the server.", pName);
    SendClientMessageToAll(COLOR_GREY, string);

    if(!strcmp("[ViP]Labrik",pName,true) || !strcmp("netzeek",pName,true) || !strcmp("[MT]Lavis",pName,true))
    {
      new kstring[128];
      format(kstring, sizeof(kstring), "%s was auto kicked from the server (illegal name).", pName);
    SendClientMessageToAll(COLOR_GREY, kstring);
    print(kstring);
        Kick(playerid);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new String[ 80 ] , PName[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid , PName , sizeof( PName ) );
    switch(reason)
    {
        case 0: format(String, sizeof(String), "%s lost connection to the server. (timeout)", PName);
        case 1: format(String, sizeof(String), "%s has left the server.", PName);
        case 2: format(String, sizeof(String), "%s has left the server. (kicked)", PName);
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid, 100);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
    GameTextForPlayer(playerid,"~w~OMG, CALL THE AMBULANCE!",1000,1);
    SendDeathMessage(killerid, playerid, reason);
    GameTextForPlayer(killerid,"~r~You Murderer!",4000,3);
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    SpamStrings[playerid] ++;
    if(SpamStrings[playerid] >= MAX_SPAM)
    {
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
        printf("(previous text of %s was blocked by antispam)", PlayerName);
        SendClientMessage(playerid,0xCC0000AA,"Please wait 20 seconds before you spam again (spam protection).");
        return 0;
    }
    new textstring[128];
    format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
    SendPlayerMessageToAll(playerid, textstring);
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/parachute", true) == 0)
    {
        GivePlayerWeapon(playerid, 46, 1);
        SendClientMessage(playerid,COLOR_GREEN,"Use it well!");
        PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
        return 1;
    }
    if (strcmp(cmdtext, "/flip", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:PX, Float:PY, Float:PZ, Float:PA;
            GetPlayerPos(playerid, PX, PY, PZ);
            GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
            SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SendClientMessage(playerid, COLOR_BASIC,"Vehicle Fliped!");
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED,"Cn you flip your self?");
        }
        return 1;
    }

    if (strcmp(cmdtext, "/lock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                if(i != playerid)
                {
                    SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                }
            }
            SendClientMessage(playerid, COLOR_BASIC, "Vehicle locked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1056,pX,pY,pZ);
            PlayerPlaySound(playerid, 1137,pX,pY,pZ);
            locked[playerid][GetPlayerVehicleID(playerid)] = 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
        }
        return 1;
    }

    if (strcmp(cmdtext, "/unlock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
            }
            SendClientMessage(playerid, COLOR_BASIC, "Vehicle unlocked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid, 1058,pX,pY,pZ);
            locked[playerid][GetPlayerVehicleID(playerid)] = 0;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
        }
        return 1;
    }
    if (strcmp(cmdtext, "/savep", true)==0)
    {
        GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
        GetPlayerFacingAngle(playerid, PosA[playerid]);
        SendClientMessage(playerid, COLOR_BASIC, "Positon set! Go to this possiton with /loadp");
        PosI[playerid] = (GetPlayerInterior(playerid));
        PlayerPlaySound(playerid, 1137  , 0.0, 0.0, 0.0);
        return 1;
    }

    if (strcmp(cmdtext, "/loadp", true)==0)
    {
        if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
    {
            return SendClientMessage(playerid, COLOR_RED, "Use /savep first!");
        }
        else
        {
            ResetPlayerWeapons(playerid);
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
                SetCameraBehindPlayer(playerid);
            LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
            }
        else
        {
                InCar[playerid] = false;
                SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
            SetPlayerFacingAngle(playerid, PosA[playerid]);
                SetCameraBehindPlayer(playerid);
            }
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
            SetPlayerInterior(playerid, PosI[playerid]);
            SendClientMessage(playerid, COLOR_BASIC, "Position Loaded");
        }
        return 1;
  }
    return 0;
}
Reply
#7

It's not WORKING !

5 ERRORS , AGAIN ! ...

Код:
C:\Documents and Settings\User\Desktop\GM.pwn(59) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(85) : error 017: undefined symbol "FadePlayerScreen"
C:\Documents and Settings\User\Desktop\GM.pwn(86) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(89) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(161) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(162) : warning 217: loose indentation
C:\Documents and Settings\User\Desktop\GM.pwn(165) : error 017: undefined symbol "locked"
C:\Documents and Settings\User\Desktop\GM.pwn(165) : warning 215: expression has no effect
C:\Documents and Settings\User\Desktop\GM.pwn(165) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\User\Desktop\GM.pwn(165) : error 029: invalid expression, assumed zero
C:\Documents and Settings\User\Desktop\GM.pwn(165) : fatal error 107: too many error messages on one line

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


5 Errors.
What's your sa-mp and pawno version ?
Reply
#8

Quote:
Originally Posted by Marcel
Here, but you don't have FadePlayerScreen, search for it on the forums.
pawn Код:
CODE WAS HERE
Reply
#9

I AM WITH SEIFADER NOW

Errors :

Код:
C:\Documents and Settings\User\Desktop\SAURP\pawno\include\Seifader.inc(71) : warning 203: symbol is never used: "reason"
C:\Documents and Settings\User\Desktop\GM.pwn(50) : error 001: expected token: ";", but found "new"
C:\Documents and Settings\User\Desktop\GM.pwn(69) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\GM.pwn(72) : error 017: undefined symbol "String"
C:\Documents and Settings\User\Desktop\GM.pwn(72) : error 017: undefined symbol "String"
C:\Documents and Settings\User\Desktop\GM.pwn(72) : error 036: empty statement
C:\Documents and Settings\User\Desktop\GM.pwn(72) : fatal error 107: too many error messages on one line

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


5 Errors.
Reply
#10

pawn Код:
#include <a_samp>
#include <xClient>
#include <Seifader>

#define COLOR_BASIC 0xAFAFAFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_DARK_RED 0xAA3333AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x0000AA20
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define MAX_SPAM 6

new SpamStrings[MAX_PLAYERS];
new locked[MAX_PLAYERS][MAX_VEHICLES];
enum SavePosENUM { Float:sX, Float:sY, Float:sZ, Float:sA, SavedPos };
new SavePos[MAX_PLAYERS][SavePosENUM];
new PosI[MAX_PLAYERS];
new InCar[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" ~ Ultimate Clean GM by Hot ~");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Stunt•Freeroam•DM•Fun");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, COLOR_GREEN, "Welcome San Andreas Stunters, Have fun!");
    new pName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s has joined the server.", pName);
    SendClientMessageToAll(COLOR_GREY, string);
    SavePos[playerid][SavedPos] = 1;

    if(!strcmp("[ViP]Labrik",pName,true) || !strcmp("netzeek",pName,true) || !strcmp("[MT]Lavis",pName,true))
    {
        new kstring[128];
        format(kstring, sizeof(kstring), "%s was auto kicked from the server (illegal name).", pName);
        SendClientMessageToAll(COLOR_GREY, kstring);
        print(kstring);
        Kick(playerid);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new string[128];
    new pName[24];
    GetPlayerName(playerid, pName, 24);
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s lost connection to the server. (timeout)", pName);
        case 1: format(string, sizeof(string), "%s has left the server.", pName);
        case 2: format(string, sizeof(string), "%s has left the server. (kicked)", pName);
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid, 100);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    FadePlayerScreen(playerid, 0xFFFFFFCC, 192); //playerid, color, time
    GameTextForPlayer(playerid,"~w~OMG, CALL THE AMBULANCE!",1000,1);
    SendDeathMessage(killerid, playerid, reason);
    GameTextForPlayer(killerid,"~r~You Murderer!",4000,3);
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    SpamStrings[playerid] ++;
    if(SpamStrings[playerid] >= MAX_SPAM)
    {
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
        printf("(previous text of %s was blocked by antispam)", PlayerName);
        SendClientMessage(playerid,0xCC0000AA,"Please wait 20 seconds before you spam again (spam protection).");
        return 0;
    }
    new textstring[128];
    format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
    SendPlayerMessageToAll(playerid, textstring);
    return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/parachute", true) == 0)
    {
        GivePlayerWeapon(playerid, 46, 1);
        SendClientMessage(playerid,COLOR_GREEN,"Use it well!");
        PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
        return 1;
    }

    if(strcmp(cmdtext, "/flip", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:PX, Float:PY, Float:PZ, Float:PA;
            GetPlayerPos(playerid, PX, PY, PZ);
            GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
            SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SendClientMessage(playerid, COLOR_BASIC,"Vehicle Fliped!");
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED,"Cn you flip your self?");
        }
        return 1;
    }
   
    if(strcmp(cmdtext, "/lock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                if(i != playerid)
                {
                    SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                }
            }
            SendClientMessage(playerid, COLOR_BASIC, "Vehicle locked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1056,pX,pY,pZ);
            PlayerPlaySound(playerid, 1137,pX,pY,pZ);
            locked[playerid][GetPlayerVehicleID(playerid)] = 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
        }
        return 1;
    }

    if(strcmp(cmdtext, "/unlock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
            }
            SendClientMessage(playerid, COLOR_BASIC, "Vehicle unlocked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid, 1058,pX,pY,pZ);
            locked[playerid][GetPlayerVehicleID(playerid)] = 0;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
        }
        return 1;
    }

    if(strcmp(cmdtext, "/savep", true)==0)
    {
        GetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
        GetPlayerFacingAngle(playerid, SavePos[playerid][sA]);
        SendClientMessage(playerid, COLOR_BASIC, "Positon set! Go to this possiton with /loadp");
        PosI[playerid] = (GetPlayerInterior(playerid));
        SavePos[playerid][SavedPos] = 1;
        PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
        return 1;
    }

    if(strcmp(cmdtext, "/loadp", true)==0)
    {
        if(SavePos[playerid][SavedPos] == 0)
        {
            return SendClientMessage(playerid, COLOR_RED, "Use /savep first!");
        }
        else
        {
            ResetPlayerWeapons(playerid);
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                SetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]);
                SetCameraBehindPlayer(playerid);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
            }
            else
            {
                InCar[playerid] = false;
                SetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
                SetPlayerFacingAngle(playerid, SavePos[playerid][sA]);
                SetCameraBehindPlayer(playerid);
            }
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
            SetPlayerInterior(playerid, PosI[playerid]);
            SendClientMessage(playerid, COLOR_BASIC, "Position Loaded");
        }
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)