[Tutorial] How to make a /cuff and /uncuff command.
#21

Errors:
Quote:

C:\Users\4neals\Desktop\Samp\gamemodes\FreeRoam.pw n(179) : error 029: invalid expression, assumed zero
C:\Users\4neals\Desktop\Samp\gamemodes\FreeRoam.pw n(179) : error 017: undefined symbol "cmd_cuff"
C:\Users\4neals\Desktop\Samp\gamemodes\FreeRoam.pw n(179) : error 029: invalid expression, assumed zero
C:\Users\4neals\Desktop\Samp\gamemodes\FreeRoam.pw n(179) : fatal error 107: too many error messages on one line

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


4 Errors.

My full script
Quote:

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA
#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREY 0xAFAFAFAA
stock AddClasses()
{
new a = 0;
while(a <= 299)
{

main()
{
print("\n----------------------------------");
print(" Future FreeRoam Server - NealP");
print("----------------------------------\n");
}



public OnGameModeInit()
{
AddPlayerClass(a, 2485.6213,-1665.0665,15, -1, 0, 0, 0, 0, 0, 0);
a = a + 1;
}
}
SetGameModeText("Welcome to the Future FreeRoam");
ManualVehicleEngineAndLights();
DisableInteriorEnterExits()
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)
{
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has joined the server. Welcome!",pName);
SendClientMessageToAll(0xFFFFFFAA,string);

GameTextForPlayer(playerid,"~w~The Future Freeroam",3000,4);
SendClientMessage(playerid,COLOR_WHITE, "Welcome to The {FF0000}F{FFFFFF}uture {00FF00}F{FFFFFF}ree{0080FF}R{FFFFFF}oam");
return 1;
}

public OnPlayerSpawn(playerid)
{
SetPlayerColor(playerid,COLOR_WHITE);
GivePlayerMoney(playerid, 1000);
GivePlayerWeapon(playerid, WEAPON_COLT45,100);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerPos(playerid, 1172.9683,-1323.3954,15.3982);
SendClientMessage(playerid,COLOR_YELLOW,"You were treated by medical doctors in All Saints Hospital. Please be careful next time.");
SendClientMessage(playerid,COLOR_YELLOW,"You were deducted by $200 for your medical bill. Have a safe day!");
GivePlayerMoney(playerid,-200);
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
if (IsPlayerAdmin(playerid))
SendClientMessage(playerid,COLOR_RED,"You commited suicide.");
SetPlayerHealth(playerid,0);
return 1;
}
if (strcmp("/adminstarter", cmdtext, true, 10) == 0)
{
if (IsPlayerAdmin(playerid))
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,WEAPON_MINIGUN,999999);
GivePlayerWeapon(playerid,WEAPON_M4,999999);
GivePlayerWeapon(playerid,WEAPON_DEAGLE,999999);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USE JETPACK);
return 1;
}
if (strcmp("/engine", cmdtext, true, 10) == 0)//your command.
{
new vehicleid = GetPlayerVehicleID(playerid);//defining vehicleid is = to GetPlayerVehicleID.
new engine, lights, alarm, doors, bonnet, boot, objective;//these are the defines of the thing used in the command.
if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not.
{
if(GetPlayerVehicleSeat(playerid) == 0) //Now this will check that if a player is on the driving seat or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,d oors,bonnet,boot,objective);//will check that what is the state of the engine.
if(engine == 1)//will check that if the wngine in on or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,d oors,bonnet,boot,objective);//this will check that what is the state of engine.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the engine only.
SetVehicleParamsEx(vehicleid,false,lights,alarm,do ors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on.
GameTextForPlayer(playerid,"Vehicle Engine Stopped!",2000,6);//for a text to appar on the screen for only 2 seconds.
return 1;
}
else
SetVehicleParamsEx(vehicleid,true,lights,alarm,doo rs,bonnet,boot,objective);//if vehicle engine is false it will change it to true.
GameTextForPlayer(playerid,"Vehicle Engine Started!",2000,6);//for a text to appar on the screen for only 2 seconds.
}
else SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear.
return 1;
}
else
SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper.
}
if (strcmp("/lock", cmdtext, true, 10) == 0)//your command.
{
new engine, lights, alarm, doors, bonnet, boot, objective;
new vehicleid = GetPlayerVehicleID(playerid);//defining vehicleid is = to GetPlayerVehicleID.
if(IsPlayerInAnyVehicle(playerid))//Thsi will check that is a player In a vehcile or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,d oors,bonnet,boot,objective);//will check that what is the state of the vehicle lock.
if(doors == 1)//will check if the doors are already loocked it not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,d oors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,f alse,bonnet,boot,objective);//same as the engine one.
GameTextForPlayer(playerid,"Vehicle Unlocked!",2000,6);//for a text to appar on the screen for only 2 seconds.
return 1;
}
else
SetVehicleParamsEx(vehicleid,engine,lights,alarm,t rue,bonnet,boot,objective);
GameTextForPlayer(playerid,"Vehicle Locked!",2000,6);//for a text to appar on the screen for only 2 seconds.
}
else
SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//the error message.
}
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string, sizeof(string), "You are entering vehicle %i", vehicleid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
new string[35];
format(string, sizeof(string), "INFO: You are exiting vehicle %i", vehicleid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
new
szString[64],
playerName[MAX_PLAYER_NAME];

GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);

new szDisconnectReason[3][] =
{
"Timeout/Crash",
"Quit",
"Kick/Ban"
};

format(szString, sizeof szString, "%s left the server (%s).", playerName, szDisconnectReason[reason]);

SendClientMessageToAll(0xC4C4C4FF, szString);
return 1;
}

Reply
#22

Thanks for any help
Reply
#23

Quote:
Originally Posted by NealPeteros
Посмотреть сообщение
Thanks for any help
why didnt u just do a paste bin are post in scripters help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)