Why this -
CallumDaBest - 05.02.2014
Hello i am creating a script and this error keeps poping up - C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(534 ) : error 021: symbol already defined: "TogglePlayerControllable"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Why is that and here's the code!
forward TutorialStart(playerid);
forward TutorialPart1(playerid);
forward TutorialPart2(playerid);
forward TutorialPart3(playerid);
forward TutorialPart4(playerid);
forward TutorialPart5(playerid);
forward TutorialPart6(playerid);
forward TutorialEnd(playerid);
TogglePlayerControllable(playerid,0);
SetPlayerCameraPos(playerid, 1489.8673,-1603.2789,54.3335);
SetPlayerCameraLookAt(playerid, 1543.2408,-1658.4531,13.5606);
SetTimer("TutorialStart",7000,0);
public TutorialStart(playerid)
{
SendClientMessage(playerid, 0xFFFF00AA,"Tutorial:");
SendClientMessage(playerid, 0xFFFFE0FF,"This is a roleplay server called Millenium Roleplay - Roleplay which means you have to act out as someone in real life!.");
SendClientMessage(playerid, 0xFFFFE0FF,"Please pay attention to avoid asking question later on.");
SetTimer("TutorialPart1", 8000,0);
}
public TutorialPart2(playerid)
{
SetPlayerCameraPos(playerid, 1509.7393,-1610.2775,14.0469);
SetPlayerCameraLookAt(playerid, 1542.6451,-1648.0046,13.9816);
SendClientMessage(playerid, 0xFFFF00AA,"Police:");
SendClientMessage(playerid, 0xFFFFE0FF,"This is the Los Santos Police Department. If you cause trouble, you will be sent to jail.");
SendClientMessage(playerid, 0xFFFFE0FF,"If you want to become a Police officer call up an Officer(Blue Names).");
SendClientMessage(playerid, 0xFFFFE0FF,"If you are attacker or in trouble, call /911.");
SetTimer("TutorialPart3",10000,0);
}
public TutorialPart3(playerid)
{
SetPlayerCameraPos(playerid, 1405.8905,-1370.0909,34.5451);
SetPlayerCameraLookAt(playerid, 1425.0016,-1319.9821,14.9769);
SendClientMessage(playerid, 0xFFFF00AA,"Rules:");
SendClientMessage(playerid, 0xFFFFE0FF,"No deathmatching aka don't kill without a reason.");
SendClientMessage(playerid, 0xFFFFE0FF,"No Driver shooting aka shooting behind the wheel. Passenger may drive-by.");
SendClientMessage(playerid, 0xFFFFE0FF,"No Carparking aka parking cars on people.");
SendClientMessage(playerid, 0xFFFFE0FF,"No Disconnecting to Avoid Death.");
SendClientMessage(playerid, 0xFFFFE0FF,"No Account Farming/Advertising/Cheating.");
SendClientMessage(playerid, 0xFFFFE0FF,"Failing to Comply with any of the above rules could result in being Permanently Banned.");
SetTimer("TutorialPart4",10000,0);
}
public TutorialPart4(playerid)
{
SetPlayerCameraPos(playerid, 2450.4207,-1646.8220,13.4700);
SetPlayerCameraLookAt(playerid, 2499.1904,-1678.5753,13.3576);
SendClientMessage(playerid, 0xFFFF00AA,"Gangs:");
SendClientMessage(playerid, 0xFFFFE0FF,"Type /families to display a list of gangs.");
SendClientMessage(playerid, 0xFFFFE0FF,"/families [number] to show their members, ask the member how to join.");
SendClientMessage(playerid, 0xFFFFE0FF,"Gang members can take control of weapons/fuel/drugs trade to earn money.");
SendClientMessage(playerid, 0xFFFFE0FF,"/points to display what points/businesses can be controlled.");
SetTimer("TutorialPart5",10000,0);
}
public TutorialPart5(playerid)
{
SetPlayerCameraPos(playerid, 1293.0363,-943.5465,41.8594);
SetPlayerCameraLookAt(playerid, 1315.7174,-900.9848,39.5781);
SendClientMessage(playerid, 0xFFFF00AA,"24/7:");
SendClientMessage(playerid, 0xFFFFE0FF,"You can purchase different items with the /buy command from any 24/7.");
SendClientMessage(playerid, 0xFFFFE0FF,"Buying a cellphone will give you the ability to /call or /txt other players.");
SendClientMessage(playerid, 0xFFFFE0FF,"You can also /sellfish at any of the 24/7's located around Los Santos.");
SetTimer("TutorialPart6",10000,0);
}
public TutorialPart6(playerid)
{
SetPlayerCameraPos(playerid, 1362.1287,-1280.0468,13.382
;
SetPlayerCameraLookAt(playerid, 1367.7405,-1279.7548,13.5469);
SendClientMessage(playerid, 0xFFFF00AA,"Businesses:");
SendClientMessage(playerid, 0xFFFFE0FF,"Businesses are great way to make Money.");
SendClientMessage(playerid, 0xFFFFE0FF,"When someone buys a item from the business, the money will go into the Business till.");
SendClientMessage(playerid, 0xFFFFE0FF,"Business cost alot to purchase, but it is worth it in long run.");
SendClientMessage(playerid, 0xFFFFE0FF,"You may purchase business from oher players.");
SendClientMessage(playerid, 0xFFFFE0FF,"Remember this is a custom script and still in ALPHA Mode - Not comepleted, Have lots of fun.");
SetTimer("TutorialEnd",10000,0);
}
public TutorialEnd(playerid)
{
TogglePlayerControllable(playerid,1);
SpawnPlayer(playerid);
SendClientMessage(playerid, 0xFFFF00AA,"You have been now spawned, Tutorial is Over.");
SendClientMessage(playerid, 0xFFFF00AA,"Have fun on Millenium Roleplay - Remember if you are stuck please do /newb or /am.");
}
Re: Why this -
BullseyeHawk - 05.02.2014
You're calling TogglePlayerControllable outside any function, the complier guesses that you're trying to declare this as a function but it's already declared. You need to use this function inside a public function. For example OnPlayerConnect
Re: Why this -
Borg - 05.02.2014
You have to call these functions in code of other functions:
pawn Код:
TogglePlayerControllable(playerid,0);
SetPlayerCameraPos(playerid, 1489.8673,-1603.2789,54.3335);
SetPlayerCameraLookAt(playerid, 1543.2408,-1658.4531,13.5606);
SetTimer("TutorialStart",7000,0);