SA-MP Forums Archive
Set commands - 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: Set commands (/showthread.php?tid=187051)



Set commands - knackworst - 31.10.2010

How can I set commands instead of this: A player uses the command and it happends to himself
to this: An admin (or other player) uses a command and can set the command to a player...

?
for example:

/heal
and /setplayerhealth

wel how do I do the second one?


Re: Set commands - dark_clown - 31.10.2010

new id;
then swtich playerid to id


Re: Set commands - knackworst - 31.10.2010

Didn't work!
I get erros...

if(strcmp("/throw", cmdtext, true) == 0)
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(ID, 0xFF8000FF, "You have been teleported away because you were stalking!");
SetPlayerPos(ID, 419.800018, 2531.705322, 16.157726);
}
return 1;
}

erros: C:\Users\William\Downloads\Ti+Stuntacular\gamemode s\Tropical_Island.pwn(406) : error 017: undefined symbol "ID"
C:\Users\William\Downloads\Ti+Stuntacular\gamemode s\Tropical_Island.pwn(407) : error 017: undefined symbol "ID"


Re: Set commands - Freddi-25 - 31.10.2010

Quote:
Originally Posted by knackworst
Посмотреть сообщение
Didn't work!
I get erros...

if(strcmp("/throw", cmdtext, true) == 0)
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(ID, 0xFF8000FF, "You have been teleported away because you were stalking!");
SetPlayerPos(ID, 419.800018, 2531.705322, 16.157726);
}
return 1;
}

erros: C:\Users\William\Downloads\Ti+Stuntacular\gamemode s\Tropical_Island.pwn(406) : error 017: undefined symbol "ID"
C:\Users\William\Downloads\Ti+Stuntacular\gamemode s\Tropical_Island.pwn(407) : error 017: undefined symbol "ID"
Change ID to playerid? I'm pretty sure you should NOT use ID there.


Re: Set commands - [L3th4l] - 31.10.2010

I REALLY SUGGEST USING SSCANF2 + ZCMD! AND YES I"M WRITING IN CAPS SO U CAN UNDERSTAND HOW EASY IS TO SCRIPT LIKE THIS

pawn Код:
CMD:sethealth(playerid, params[])
{
    new ToID, Health;
    if(sscanf(params, "ui", ToID, Health)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /SetHealth < PlayerID > < Amount >");
    if(!IsPlayerConnected(ToID)) return SendClientMessage(playerid, COLOR_RED, "That user is not connected!");
    SetPlayerHealth(ToID, Health);
    return 1;
}
pawn Код:
CMD:throw(playerid, params[])
{
    new ToID;
    if(sscanf(params, "u", ToID)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /Throw < PlayerID >");
    if(!IsPlayerConnected(ToID)) return SendClientMessage(playerid, COLOR_RED, "That user is not connected!");
    SetPlayerPos(ToID, 419.800018, 2531.705322, 16.157726);
    SendClientMessage(ToID, 0xFF8000FF, "You have been teleported away because you were stalking!");
    return 1;
}
See how easy it is to script that way?


Re: Set commands - knackworst - 31.10.2010

THen how should it be?

I don't understand a shit about that other stuff you just send me...

How can I just do it the simple way?


Re: Set commands - Mike_Peterson - 31.10.2010

Knack, come online on MSN real quick? if ur here within 5 minutes i may am able to help you