SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 29/04/2011, 11:27 AM   #21
Aizen
Big Clucker
 
Join Date: Apr 2011
Posts: 102
Reputation: 0
Default Re: How to make /enter command with text tht shows up

Still cant /enter man........ well i guess that code all correct.usually what range to /enter and /exit?
__________________
Aizen is offline   Reply With Quote
Old 25/09/2011, 11:38 AM   #22
foefjoekel
Little Clucker
 
Join Date: Feb 2011
Posts: 15
Reputation: 0
Default Re: How to make /enter command with text tht shows up

way doesent work i trayd to edit and let it so but nothing works did i put it in the wrong place or yea tips plz
foefjoekel is offline   Reply With Quote
Old 25/09/2011, 12:48 PM   #23
foefjoekel
Little Clucker
 
Join Date: Feb 2011
Posts: 15
Reputation: 0
Default Re: How to make /enter command with text tht shows up

i got it working bi i can onley go troucht it without car but it is a car parking place so how do i get my car whit me ?
foefjoekel is offline   Reply With Quote
Old 02/10/2011, 07:45 AM   #24
D-12
Little Clucker
 
D-12's Avatar
 
Join Date: May 2011
Posts: 36
Reputation: 1
Default Re: How to make /enter command with text tht shows up

\gamemodes\First.pwn(154) : warning 209: function "OnPlayerCommandText" should return a value
\gamemodes\First.pwn(154) : error 010: invalid function or declaration
\gamemodes\First.pwn(156) : error 010: invalid function or declaration
\gamemodes\First.pwn(159) : error 010: invalid function or declaration
\gamemodes\First.pwn(162) : error 054: unmatched closing brace ("}")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

I copied your code and placed it under OnPlayerCommandText. I get those errors for some reason.
D-12 is offline   Reply With Quote
Old 02/10/2011, 07:47 AM   #25
=WoR=G4M3Ov3r
High-roller
 
Join Date: Nov 2010
Location: www.Ambrosia-Servers.com
Posts: 1,855
Reputation: 327
Default Re: How to make /enter command with text tht shows up

Quote:
Originally Posted by D-12 View Post
\gamemodes\First.pwn(154) : warning 209: function "OnPlayerCommandText" should return a value
\gamemodes\First.pwn(154) : error 010: invalid function or declaration
\gamemodes\First.pwn(156) : error 010: invalid function or declaration
\gamemodes\First.pwn(159) : error 010: invalid function or declaration
\gamemodes\First.pwn(162) : error 054: unmatched closing brace ("}")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

I copied your code and placed it under OnPlayerCommandText. I get those errors for some reason.
return 0;

in the end after the return 1 in OnPlayerCommandText
=WoR=G4M3Ov3r is offline   Reply With Quote
Old 02/10/2011, 09:18 AM   #26
Pharrel
High-roller
 
Pharrel's Avatar
 
Join Date: Feb 2011
Location: Brazil
Posts: 1,535
Reputation: 132
Default Re: How to make /enter command with text tht shows up

I start my own GM and today i was creating the entrances/exits and i think (omfg this will take an hour --') and i create a command who save all in the log and you just want to type /entrance [name] then /exit then ctrl c + ctrl v from your server_log

pawn Code:
new Float:Entradax[MAXPLAYERS], Float:Entraday[MAXPLAYERS], Float:Entradaz[MAXPLAYERS], Float:Entradaa[MAXPLAYERS], Entradainterior[MAXPLAYERS], Entrada[MAXPLAYERS][MAXPLAYERS], Float:Saidax[MAXPLAYERS], Float:Saiday[MAXPLAYERS], Float:Saidaz[MAXPLAYERS], Float:Saidaa[MAXPLAYERS],Saidainterior[MAXPLAYERS];
CMD:entrance(playerid,params[])
{
    if(sscanf(params, "s[30]",text))
        return SendClientMessage(playerid, COLOR_RED, "[Erro]{b4b5b7} Uso: /entrance [entrance name]");
    format(Entrada[playerid],50, text);
    GetPlayerPos(playerid, Entradax[playerid],Entraday[playerid],Entradaz[playerid]);
    GetPlayerFacingAngle(playerid, Entradaa[playerid]);
    Entradainterior[playerid] = GetPlayerInterior(playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "Entrada Salva!");
    return 1;
}
CMD:exit(playerid)
{
    GetPlayerPos(playerid, Saidax[playerid],Saiday[playerid],Saidaz[playerid]);
    GetPlayerFacingAngle(playerid, Saidaa[playerid]);
    Saidainterior[playerid] = GetPlayerInterior(playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "Saida Salva!");
    CriarEntradas(Entradax[playerid], Entraday[playerid], Entradaz[playerid], Entradaa[playerid], Entradainterior[playerid], Entrada[playerid], Saidax[playerid], Saiday[playerid], Saidaz[playerid], Saidaa[playerid],Saidainterior[playerid]);
    return 1;
}
//Comandos de Administradores <-
forward CriarEntradas(Float:entradax, Float:entraday, Float:entradaz, Float:entradaa, entradainterior, entrada[], Float:saidax, Float:saiday, Float:saidaz, Float:saidaa,saidainterior);
public CriarEntradas(Float:entradax, Float:entraday, Float:entradaz, Float:entradaa, entradainterior, entrada[], Float:saidax, Float:saiday, Float:saidaz, Float:saidaa,saidainterior)
{
    printf("else if(IsPlayerInRangeOfPoint(playerid, 3.0, %f, %f, %f)) // Exit %s",entradax, entraday, entradaz,entrada);
    printf("    return SetPerfectPos(playerid, %f,%f,%f,%f,%d);",saidax, saiday, saidaz, saidaa+180.0, saidainterior);
    printf("else if(IsPlayerInRangeOfPoint(playerid, 3.0, %f, %f, %f)) // Exit %s",saidax, saiday, saidaz,entrada);
    printf("    return SetPerfectPos(playerid, %f,%f,%f,%f,%d);\r\n",entradax, entraday, entradaz, entradaa+180.0, entradainterior);
    printf("AddStaticPickup(1318, 1,%f,%f,%f,0); // Entrance %s\r\n",entradax, entraday, entradaz, entrada);
    printf("Create3DTextLabel('Exit', COLOR_YELLOW, %f,%f,%f,30,0,1); // Exit %s\r\n",saidax, saiday, saidaz,entrada);
    return 1;
}

stock SetPerfectPos(playerid,Float:X,Float:Y,Float:Z,Float:A,Int,VW = 0)
{
    SetPlayerPos(playerid, X,Y,Z);
    SetPlayerFacingAngle(playerid, A);
    SetPlayerInterior(playerid, Int);
    SetPlayerVirtualWorld(playerid, VW);
    SetCameraBehindPlayer(playerid);
    return 1;
}

I'm brazilian... so somethings are in portuguese...and right now here is 06:17a.m so i'm not really interested in translate all...

ps: in the 3Dtextlabel you must change 'Exit' to "Exit"!
__________________

"Afirmo que ambos somos ateus. Apenas acredito num deus a menos que você.
Quando você entender porque é que rejeita todos os outros deuses possíveis,
entenderá porque é que eu rejeito o seu."
Stephen Henry Roberts
Pharrel is offline   Reply With Quote
Old 25/12/2011, 10:43 PM   #27
rubygta
Big Clucker
 
rubygta's Avatar
 
Join Date: Dec 2008
Location: My house in Norway
Posts: 99
Reputation: 4
Default Re: How to make /enter command with text tht shows up

Very well-explained and useful. Thank you for an awesome tutorial.
__________________
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
    SendClientMessage(playerid, EVIL_RED, "Screw you.");
    Ban(playerid);
        return 1;
}
rubygta is offline   Reply With Quote
Old 19/06/2012, 12:45 PM   #28
Frosty_LV
Big Clucker
 
Frosty_LV's Avatar
 
Join Date: Jun 2012
Location: Latvia
Posts: 66
Reputation: 4
Default Re: How to make /enter command with text tht shows up

Looks great tutorial, but the problem for me is - when I press Compile/Run then it gives me an error where is written, that Pawn Compiler Library crashed or something like that.
__________________
Frosty_LV is offline   Reply With Quote
Old 23/06/2012, 11:22 PM   #29
JustinAn
Huge Clucker
 
JustinAn's Avatar
 
Join Date: Apr 2012
Location: Why?
Posts: 237
Reputation: 27
Default Re: How to make /enter command with text tht shows up

Nice tutorial, great.
JustinAn is offline   Reply With Quote
Old 23/06/2012, 11:45 PM   #30
Naruto_Emilio
High-roller
 
Naruto_Emilio's Avatar
 
Join Date: Apr 2011
Location: I really don't know
Posts: 1,839
Reputation: 308
Default Re : How to make /enter command with text tht shows up

You explained alot, it seems a good tutorial for Beginners
__________________
Need your Android Application on Google Play for free? CONTACT
ME!

Pawn Scripting in exchange of cash.
Naruto_Emilio is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 08:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.