Ls In Dcmd!!! - 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: Ls In Dcmd!!! (
/showthread.php?tid=259922)
Ls In Dcmd!!! -
IvancheBG - 06.06.2011
Ok i made a /ls command to teleport you to ls but in the orignial way i wnat in dcmd but i this commadn i made it to teleport with car and in dcmd i want it to .here is my command:
Код:
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2497.0798, -1666.4255, 13.3438);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
else
{
SetPlayerPos(playerid, 2497.0798, -1666.4255, 13.3438);
}
new playername[MAX_PLAYER_NAME], string[90];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s has been teleported to Los Santos.", playername);
SendClientMessageToAll(0xFFFF00AA, string);
return 1;
}
Re: Ls In Dcmd!!! -
SpiderWalk - 06.06.2011
pawn Код:
dcmd(ls,2,cmdtext);//in OnPlayerCommandText
dcmd_ls(playerid,params[])//Under OnPlayerCommandText
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2497.0798, -1666.4255, 13.3438);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
else
{
SetPlayerPos(playerid, 2497.0798, -1666.4255, 13.3438);
}
new playername[MAX_PLAYER_NAME], string[90];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s has been teleported to Los Santos.", playername);
SendClientMessageToAll(0xFFFF00AA, string);
return 1;
}
Re: Ls In Dcmd!!! -
IvancheBG - 06.06.2011
I have one question why in dcmd(ls,2,cmdtext)
Number 2 wath is it for?
Re: Ls In Dcmd!!! -
Kwarde - 06.06.2011
That's because 'ls' contains two characters.
The dcmd command 'helloworld' should look like this:
pawn Код:
dcmd(helloworld, 10, cmdtext);
because it contains ten characters
Re: Ls In Dcmd!!! -
itachi4x4 - 06.06.2011
Its 2 because the length of ls is 2
Re: Ls In Dcmd!!! -
Kwarde - 06.06.2011
Itachi, why do you answer while I already answered the question? That's kinda useless / spam (for higher post counter).
Re: Ls In Dcmd!!! -
IvancheBG - 06.06.2011
oo I get it Thanks spdierWalk,Kwarde and itachi4x4
Re: Ls In Dcmd!!! -
SpiderWalk - 06.06.2011
It for number of words ex. dcmd(ls,2,cmdtext);
That 2 is number of words
Re: Ls In Dcmd!!! -
Kwarde - 06.06.2011
facepalm
I've answered that already, then someone else did (unneeded) and he said thanks already. Now you're saying it again? Sorry but that quite looks like spam.
Re: Ls In Dcmd!!! -
IvancheBG - 09.06.2011
I have a problem with this command when i put it in pawno it gives me those errors
Код:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(256) : warning 209: function "OnPlayerCommandText" should return a value
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(257) : warning 203: symbol is never used: "params"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(257 -- 274) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
And this is the command
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(ls,2,cmdtext);
}
dcmd_ls(playerid,params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2497.0798, -1666.4255, 13.3438);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
else
{
SetPlayerPos(playerid, 2497.0798, -1666.4255, 13.3438);
}
new playername[MAX_PLAYER_NAME], string[90];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s has been teleported to Los Santos.", playername);
SendClientMessageToAll(0xFFFF00AA, string);
return 1;
}
return 0;
}