Set commands
#1

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?
Reply
#2

new id;
then swtich playerid to id
Reply
#3

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"
Reply
#4

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.
Reply
#5

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?
Reply
#6

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?
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)