[HELP] Compile - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Compile (
/showthread.php?tid=67066)
[HELP] Compile -
Hot - 26.02.2009
I want the that any player can see the checkpoint, using playerid in the init . why it dosen't compile ?
Код:
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(17) : error 017: undefined symbol "playerid"
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(32) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(35) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(17) : warning 204: symbol is assigned a value that is never used: "CP"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Код:
#include <a_samp>
#define COLOR_RED 0xFF0000AA
new Menu:ElevatorMenu;
new CP;
public OnFilterScriptInit()
{
ElevatorMenu = CreateMenu("ElevatorMenu", 1, 50.0, 180.0, 200.0, 200.0);
AddMenuItem(ElevatorMenu, 0, "Elevator up");
AddMenuItem(ElevatorMenu, 0, "Call Elevator");
AddMenuItem(ElevatorMenu, 0, "Cancel");
CP = SetPlayerCheckpoint(playerid, 1840.252563, -1662.095337, 58.791744, 3.00);
return 1;
}
public OnPlayerSelectedMenuRow(playerid,row)
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == ElevatorMenu)
{
switch(row)
{
case 0:{
MoveObject(980,1840.252563,-1662.095337,112.666771);
}
case 1:{
MoveObject(980,1840.252563,-1662.095337,58.791744);
}
case 2:{
SendClientMessage(playerid, COLOR_RED, "Menu canceled.");
}
}
}
return 1;
}
Re: [HELP] Compile -
yom - 26.02.2009
Under OnPlayerConnect maybe?
Re: [HELP] Compile -
Hot - 26.02.2009
Nope , now I get 3 errors ...
Код:
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(17) : error 029: invalid expression, assumed zero
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(17) : error 004: function "OnPlayerConnect" is not implemented
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(19) : error 017: undefined symbol "playerid"
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(24) : warning 225: unreachable code
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(37) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(40) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\SA-MP\Servidor v1.2\Blank.pwn(19) : warning 204: symbol is assigned a value that is never used: "CP"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Код:
public OnPlayerConnect(playerid)
{
CP = SetPlayerCheckpoint(playerid, 1840.252563, -1662.095337, 58.791744, 3.00);
return 1;
}
Re: [HELP] Compile -
1337pr0 - 26.02.2009
pawn Код:
#include <a_samp>
#define COLOR_RED 0xFF0000AA
new Menu:ElevatorMenu;
new CP;
public OnFilterScriptInit()
{
ElevatorMenu = CreateMenu("ElevatorMenu", 1, 50.0, 180.0, 200.0, 200.0);
AddMenuItem(ElevatorMenu, 0, "Elevator up");
AddMenuItem(ElevatorMenu, 0, "Call Elevator");
AddMenuItem(ElevatorMenu, 0, "Cancel");
return 1;
}
public OnPlayerSpawn(playerid)
{
CP = SetPlayerCheckpoint(playerid, 1840.252563, -1662.095337, 58.791744, 3.00);
return 1;
}
public OnPlayerSelectedMenuRow(playerid,row)
{
new Menu:current;
current = GetPlayerMenu(playerid);
if(current == ElevatorMenu)
{
switch(row)
{
case 0:{
MoveObject(980,1840.252563,-1662.095337,112.666771,3);
}
case 1:{
MoveObject(980,1840.252563,-1662.095337,58.791744,3);
}
case 2:{
SendClientMessage(playerid, COLOR_RED, "Menu canceled.");
}
}
}
return 1;
}
Moved the "CP = SetPlayerCheckpoint etc." to OnPlayerSpawn, and added the missing "speed" parameter of the MoveObject function. Should at least get rid of the warnings and errors. Won't get rid of this: symbol is assigned a value that is never used: "CP", but don't worry about that for now, your script will run alright with this warning.