i am a beginner at scripting and... -
bensmart469 - 14.04.2012
so i am a beginner at scripting and i have no idea what to actually do. i would like a tutorial on scripting and what the scripts mean (i have never scripted before). i would also like to know what should i do with this file. i have this script that i followed a tutorial to make and put it on the 'new' document in pawno. i get this error though and i would like you to repost the script but fixed. here it is (ps: the script near the end is the shop script
https://sampforum.blast.hk/showthread.php?tid=313095)
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
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 OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerInfoChange(playerid)
{
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
#include <zcmd>
COMMAND:MJHotDog(playerid, params[])
{
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, MJCOLOR, "You do not have enough money to buy my hotdog special");
givePlayerMoney(playerid, -10);
SendClientMessage(playerid, MJCOLOR, "Thank you for buying my very delicious MJ Hotdog");
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.0,0,0,0,0,0,0); //Eating Animation
return 1;
}
please tell me what i have done wrong with this script. also, tell me what to save it as please
Re: i am a beginner at scripting and... -
Hoss - 14.04.2012
Quote:
Originally Posted by bensmart469
so i am a beginner at scripting and i have no idea what to actually do. i would like a tutorial on scripting and what the scripts mean (i have never scripted before). i would also like to know what should i do with this file. i have this script that i followed a tutorial to make and put it on the 'new' document in pawno. i get this error though and i would like you to repost the script but fixed. here it is (ps: the script near the end is the shop script https://sampforum.blast.hk/showthread.php?tid=313095)
pawn Код:
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; }
public OnFilterScriptExit() { return 1; }
#else
main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); }
#endif
public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Blank Script"); 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 OnPlayerRequestSpawn(playerid) { return 1; }
public OnPlayerConnect(playerid) { return 1; }
public OnPlayerDisconnect(playerid, reason) { return 1; }
public OnPlayerSpawn(playerid) { return 1; }
public OnPlayerDeath(playerid, killerid, reason) { return 1; }
public OnVehicleSpawn(vehicleid) { return 1; }
public OnVehicleDeath(vehicleid, killerid) { return 1; }
public OnPlayerText(playerid, text[]) { return 1; }
public OnPlayerPrivmsg(playerid, recieverid, text[]) { return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // Do something here return 1; } return 0; }
public OnPlayerInfoChange(playerid) { return 1; }
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; }
public OnPlayerExitVehicle(playerid, vehicleid) { return 1; }
public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; }
public OnPlayerEnterCheckpoint(playerid) { return 1; }
public OnPlayerLeaveCheckpoint(playerid) { return 1; }
public OnPlayerEnterRaceCheckpoint(playerid) { return 1; }
public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; }
public OnRconCommand(cmd[]) { return 1; }
public OnObjectMoved(objectid) { return 1; }
public OnPlayerObjectMoved(playerid, objectid) { return 1; }
public OnPlayerPickUpPickup(playerid, pickupid) { return 1; }
public OnPlayerSelectedMenuRow(playerid, row) { return 1; }
public OnPlayerExitedMenu(playerid) { return 1; } #include <zcmd> COMMAND:MJHotDog(playerid, params[]) { if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, MJCOLOR, "You do not have enough money to buy my hotdog special"); givePlayerMoney(playerid, -10); SendClientMessage(playerid, MJCOLOR, "Thank you for buying my very delicious MJ Hotdog"); ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.0,0,0,0,0,0,0); //Eating Animation return 1; }
please tell me what i have done wrong with this script. also, tell me what to save it as please
|
Add
at top of your script i suggest you to add it below
EDIT: You can use Kitten's code below my post
Re: i am a beginner at scripting and... -
Kitten - 14.04.2012
[pawn]
pawn Код:
#include <a_samp>
#include <zcmd>
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
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 OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0) {
// Do something here
return 1;
}
return 0;
}
public OnPlayerInfoChange(playerid)
{
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
COMMAND:MJHotDog(playerid, params[])
{
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, MJCOLOR, "You do not have enough money to buy my hotdog special");
givePlayerMoney(playerid, -10);
SendClientMessage(playerid, MJCOLOR, "Thank you for buying my very delicious MJ Hotdog");
//Eating Animation
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.0,0,0,0,0,0,0);
return 1;
}
Re: i am a beginner at scripting and... -
bensmart469 - 14.04.2012
hi there i followed kitten's script and came up with the same error
please help!
Re: i am a beginner at scripting and... -
Kitten - 14.04.2012
Show the error.
Re: i am a beginner at scripting and... -
bensmart469 - 14.04.2012
ok this is an image from my laptop that i just got
Re: i am a beginner at scripting and... -
Kitten - 14.04.2012
Download zcmd.
Re: i am a beginner at scripting and... -
bensmart469 - 14.04.2012
hi there kitten.
1. i just put the zcmd.inc script in notepad and saved it as zcmd.inc. is that wrong?
2. where can i download it from?
Re: i am a beginner at scripting and... -
bensmart469 - 14.04.2012
oh and where should i put it (what directory)
Re: i am a beginner at scripting and... -
Kitten - 14.04.2012
pawno\include = zcmd.inc goes in there.