SA-MP Forums Archive
[HELP] My Pawno doesn't 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] My Pawno doesn't compile! (/showthread.php?tid=130884)



[HELP] My Pawno doesn't compile! - killerpiggy - 28.02.2010

(1st solved ^^)

2nd problem -_-:
i have a question about something i didn't find on internet: if i want to make a command admin only, do i need to put if(PlayerInfo[playerid][Level] >= 1) in front of it?

EXAMPLE:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(PlayerInfo[playerid][Level] >= 1)
if (strcmp(cmdtext, "/closegarage", true) == 0){
MoveObject(gate2, -1371.383057, 922.077637, 5.851798,2);
return 1;
}
if(PlayerInfo[playerid][Level] >= 1)
if (strcmp(cmdtext, "/opengarage", true) == 0){
MoveObject(gate2, -1371.383057, 922.077637, -2.851798,2);
return 1;
}
if(PlayerInfo[playerid][Level] >= 1)
if (strcmp(cmdtext, "/closegate", true) == 0){
MoveObject(gate1, -1465.871216, 1007.168152, 8.958706,2);
return 1;
}
if(PlayerInfo[playerid][Level] >= 1)
if (strcmp(cmdtext, "/opengate", true) == 0){
MoveObject(gate1, -1465.871216, 1007.168152, 1.958706,2);
return 1;
}
}

what did i do wrong??


Re: [HELP] My Pawno doesn't compile! - aircombat - 28.02.2010

u know the folder u launch ur server from , rename it to anything like from : samp-server to server or samp . anything
________
MOTORCYCLE TIRES


Re: [HELP] My Pawno doesn't compile! - killerpiggy - 28.02.2010

^^ thanks, now it works


Re: [HELP] My Pawno doesn't compile! - aircombat - 28.02.2010

np
________
thai girl Webcams


Re: [HELP] My Pawno doesn't compile! - FoxtrotZulu - 28.02.2010

1) You missed a curly bracket at the end of this line: [pawno] if(PlayerInfo[playerid][Level] >= 1) [/pawno]
2) Do you have an array called PlayerInfo made? Or are you just seeing it in other scripts and thinking it's native?
3) And more.

[pawno]public OnPlayerCommandText(playerid, cmdtext[])
{
// CLOSE GARAGE
if (strcmp(cmdtext, "/closegarage", true) == 0)
{
if(PlayerInfo[playerid][Level] > 0)
{
MoveObject(gate2, -1371.383057, 922.077637, 5.851798,2);
SendClientMessage(playerid, 0xFFCCFFFF, "The garage was closed.");
return 1;
}
else
{
SendClientMessage(playerid, 0xCCFFFFFF, "You are not an administrator; garage was not closed.");
return 1;
}
}
// OPEN GARAGE
if (strcmp(cmdtext, "/opengarage", true) == 0)
{
if(PlayerInfo[playerid][Level] > 0)
{
MoveObject(gate2, -1371.383057, 922.077637, -2.851798,2);
SendClientMessage(playerid, 0xFFCCFFFF, "The garage was opened.");
return 1;
}
else
{
SendClientMessage(playerid, 0xCCFFFFFF, "You are not an administrator; garage was not opened.");
return 1;
}
}
// CLOSE GATE
if (strcmp(cmdtext, "/closegate", true) == 0)
{
if(PlayerInfo[playerid][Level] > 0)
{
MoveObject(gate1, -1465.871216, 1007.168152, 8.958706,2);
SendClientMessage(playerid, 0xFFCCFFFF, "The gate was closed.");
return 1;
}
else
{
SendClientMessage(playerid, 0xCCFFFFFF, "You are not an administrator; gate was not closed.");
return 1;
}
}
// OPEN GATE
if (strcmp(cmdtext, "/opengate", true) == 0)
{
if(PlayerInfo[playerid][Level] > 0)
{
MoveObject(gate1, -1465.871216, 1007.168152, 1.958706,2);
SendClientMessage(playerid, 0xFFCCFFFF, "The gate was opened.");
return 1;
}
else
{
SendClientMessage(playerid, 0xCCFFFFFF, "You are not an administrator; gate was not opened.");
return 1;
}
}
}[/pawno]

Try that.


Re: [HELP] My Pawno doesn't compile! - killerpiggy - 01.03.2010

^^ thanks. and to help u out: it's (CODE) and not (PAWNO)

(change ( to [ and ) to ])


Re: [HELP] My Pawno doesn't compile! - Koomike - 16.02.2011

Wait I think i got it now.


Re: [HELP] My Pawno doesn't compile! - Zack9764 - 16.02.2011

The player level would go after the CMD. STRCMP starts broad. Then, the more you indent, the more specific/in depth you get.