SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 28/09/2012, 03:31 PM   #11
RaZzZzoR
Big Clucker
 
Join Date: Sep 2012
Posts: 97
Reputation: 3
Default Re: Script Help

Dude, if it will show that after compile, it means there's no errors, and the script work
RaZzZzoR is offline   Reply With Quote
Old 28/09/2012, 03:43 PM   #12
EthanCortez
Little Clucker
 
Join Date: Sep 2012
Posts: 32
Reputation: 0
Default Re: Script Help

It's won't work, I joined the server and I tried all the CMD's that I added all of them failed.
EthanCortez is offline   Reply With Quote
Old 28/09/2012, 03:51 PM   #13
XtremeR
Gangsta
 
XtremeR's Avatar
 
Join Date: Aug 2012
Location: Australia
Posts: 867
Reputation: 565
Default Re: Script Help

try this

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/afk", true, 4) == 0)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, 24);
    SendClientMessage(playerid, 0xFF0000AA, "You have gone AFK..");
    SetPlayerVirtualWorld(playerid, 1337);
    TogglePlayerControllable(playerid, 0);
}
    return 1;
}
if(strcmp(cmdtext, "/back", true, 5) == 0)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, 24);
    SendClientMessage(playerid, 0xFF0000AA, "You've Back from AFK..");
    SetPlayerVirtualWorld(playerid, 0);
    TogglePlayerControllable(playerid, 1);
}
    return 1;
}
if(strcmp(cmdtext, "/aa", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1404.1338,2436.8818,16.5000);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1404.1338,2436.8818,16.5000);
    GameTextForPlayer(playerid,"Abandon Airport",4000,6);
}
    return 1;
}
if(strcmp(cmdtext, "/islanddm", true) == 0)
{
    SetPlayerInterior(playerid, 0);
    RemovePlayerFromVehicle(playerid);
    ResetPlayerWeapons(playerid);
    SetPlayerPos(playerid, 1372.8043,-3284.4734,3.1422);
    GivePlayerWeapon(playerid, 22, 5200);
    GivePlayerWeapon(playerid, 27, 1100);
    GivePlayerWeapon(playerid, 31, 4000);
    GameTextForPlayer(playerid,"Island Dm",4000,6);
}
    return 1;
}
if(strcmp(cmdtext, "/lvairstunt", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1066.05,1319.98,247.50);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,1066.05,1319.98,247.50);
    GameTextForPlayer(playerid,"Use /Carmenu for vehicles!!",4000,6);
}
    return 1;
}

}
__________________
XtremeR is offline   Reply With Quote
Old 28/09/2012, 04:08 PM   #14
EthanCortez
Little Clucker
 
Join Date: Sep 2012
Posts: 32
Reputation: 0
Default Re: Script Help

Quote:
Originally Posted by XtremeR View Post
try this

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/afk", true, 4) == 0)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, 24);
    SendClientMessage(playerid, 0xFF0000AA, "You have gone AFK..");
    SetPlayerVirtualWorld(playerid, 1337);
    TogglePlayerControllable(playerid, 0);
}
    return 1;
}
if(strcmp(cmdtext, "/back", true, 5) == 0)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, 24);
    SendClientMessage(playerid, 0xFF0000AA, "You've Back from AFK..");
    SetPlayerVirtualWorld(playerid, 0);
    TogglePlayerControllable(playerid, 1);
}
    return 1;
}
if(strcmp(cmdtext, "/aa", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1404.1338,2436.8818,16.5000);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1404.1338,2436.8818,16.5000);
    GameTextForPlayer(playerid,"Abandon Airport",4000,6);
}
    return 1;
}
if(strcmp(cmdtext, "/islanddm", true) == 0)
{
    SetPlayerInterior(playerid, 0);
    RemovePlayerFromVehicle(playerid);
    ResetPlayerWeapons(playerid);
    SetPlayerPos(playerid, 1372.8043,-3284.4734,3.1422);
    GivePlayerWeapon(playerid, 22, 5200);
    GivePlayerWeapon(playerid, 27, 1100);
    GivePlayerWeapon(playerid, 31, 4000);
    GameTextForPlayer(playerid,"Island Dm",4000,6);
}
    return 1;
}
if(strcmp(cmdtext, "/lvairstunt", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1066.05,1319.98,247.50);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,1066.05,1319.98,247.50);
    GameTextForPlayer(playerid,"Use /Carmenu for vehicles!!",4000,6);
}
    return 1;
}

}
LOL, 9 errors!

HTML Code:
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(93) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(99) : warning 217: loose indentation
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(101) : error 010: invalid function or declaration
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(104) : error 021: symbol already defined: "GetPlayerName"
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(109) : error 010: invalid function or declaration
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(111) : error 010: invalid function or declaration
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(120) : error 010: invalid function or declaration
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(122) : error 010: invalid function or declaration
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(133) : error 010: invalid function or declaration
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(135) : error 010: invalid function or declaration
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(144) : error 010: invalid function or declaration
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(281) : warning 203: symbol is never used: "name"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.
If you don't know it, why you post!?
EthanCortez is offline   Reply With Quote
Old 28/09/2012, 04:13 PM   #15
RaZzZzoR
Big Clucker
 
Join Date: Sep 2012
Posts: 97
Reputation: 3
Default Re: Script Help

Lol ?
OnPlayerCommandText must have return 0; instead of 1
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/afk", true, 4) == 0)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, 24);
    SendClientMessage(playerid, 0xFF0000AA, "You have gone AFK..");
    SetPlayerVirtualWorld(playerid, 1337);
    TogglePlayerControllable(playerid, 0);
    return 1;
}
if(strcmp(cmdtext, "/back", true, 5) == 0)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, 24);
    SendClientMessage(playerid, 0xFF0000AA, "You've Back from AFK..");
    SetPlayerVirtualWorld(playerid, 0);
    TogglePlayerControllable(playerid, 1);
    return 1;
}

if(strcmp(cmdtext, "/aa", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1404.1338,2436.8818,16.5000);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1404.1338,2436.8818,16.5000);
    GameTextForPlayer(playerid,"Abandon Airport",4000,6);
    return 1;
}

if(strcmp(cmdtext, "/islanddm", true) == 0)
{
    SetPlayerInterior(playerid, 0);
    RemovePlayerFromVehicle(playerid);
    ResetPlayerWeapons(playerid);
    SetPlayerPos(playerid, 1372.8043,-3284.4734,3.1422);
    GivePlayerWeapon(playerid, 22, 5200);
    GivePlayerWeapon(playerid, 27, 1100);
    GivePlayerWeapon(playerid, 31, 4000);
    GameTextForPlayer(playerid,"Island Dm",4000,6);
    return 1;
}

if(strcmp(cmdtext, "/lvairstunt", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1066.05,1319.98,247.50);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,1066.05,1319.98,247.50);
    GameTextForPlayer(playerid,"Use /Carmenu for vehicles!!",4000,6);
    return 1;
}
return 0;
}

Try this.
RaZzZzoR is offline   Reply With Quote
Old 28/09/2012, 04:34 PM   #16
EthanCortez
Little Clucker
 
Join Date: Sep 2012
Posts: 32
Reputation: 0
Default Re: Script Help

Ohh, thanks, now it's work .
EthanCortez is offline   Reply With Quote
Old 28/09/2012, 05:34 PM   #17
Mr.Anonymous
Gangsta
 
Mr.Anonymous's Avatar
 
Join Date: Jul 2011
Location: Every ban list
Posts: 852
Reputation: 182
Default Re: Script Help

Quote:
Originally Posted by RaZzZzoR View Post
Lol ?
OnPlayerCommandText must have return 0; instead of 1
Ohh.. I almost forgot that
Mr.Anonymous is offline   Reply With Quote
Old 28/09/2012, 05:47 PM   #18
EthanCortez
Little Clucker
 
Join Date: Sep 2012
Posts: 32
Reputation: 0
Default Re: Script Help

I guss.
EthanCortez 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hilfe beim script (es geht um nemesuns Script) godaince1 Scripting Help 0 23/09/2012 02:10 PM
Admin duty script and vehicle trunk script. Misterflowers Scripting Help 3 09/06/2012 05:57 PM
Script Translation/Traduction Script/Traducción guión Jack_Rocker Help Archive 3 22/05/2011 05:34 PM
laptop script, incorporated to my script. result: can't compile to an amx file.. nikoo Help Archive 1 14/11/2009 02:57 AM
How to script a script??? how do u scripted a script, i have no clue HELP! Badandy Help Archive 10 06/06/2009 07:57 PM


All times are GMT. The time now is 10:12 PM.


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