Command help.( Yet again )
#1

Код:
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12719) : error 017: undefined symbol "tmp0"
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : error 017: undefined symbol "tmp0"
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : error 029: invalid expression, assumed zero
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : error 017: undefined symbol "tmp0"
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
So those are the errors, and are easy to find.

I've made a command based on Lgoto, i think it should work so judge it by yourselves.

pawn Код:
CMD:vl(playerid,params[])
{
  if(PlayerInfo[playerid][Level] >=5 || IsPlayerAdmin(playerid))
  {
  if(Admin[playerid] == 0) return SP COLOR_RED, "You're not on duty");
  if(!IsPlayerInAnyVehicle(playerid)) return SP COLOR_RED, "You need to be in a vehicle");
  new Float:VLX,Float:VLZ,FloatVLY;
  new tmp1[256], tmp2[256], tmp3[256];
  new string[128], Index; tmp0 = strtok(params,Index); tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
  if(isnull(tmp0) || isnull(tmp2) || !strilen(tmp3)) return SP -1 "Usage: /vl [X], [Y], [Z]");
  x = strval(tmp0);      y = strval(tmp2);       z = strval(tmp3);
  CMDMessageToAdmins(playerid,"VL");
  SetVehicleVelocity(GetPlayerVehicleID(playerid)), x,+y,+z);
  SP blue, "Happy flying");
  } else return SendClientMessage(playerid,red, "[ERROR]: You are not a high enough level to use this command");
}
Reply
#2

Try this:
pawn Код:
CMD:vl(playerid)
{
    if(PlayerInfo[playerid][Level] >=5 || IsPlayerAdmin(playerid))
    {
        if(Admin[playerid] == 0) return SP COLOR_RED, "You're not on duty");
        if(!IsPlayerInAnyVehicle(playerid)) return SP COLOR_RED, "You need to be in a vehicle");
        new Float:VLX,Float:VLZ,FloatVLY;
        new tmp0[256], tmp1[256], tmp2[256], tmp3[256];
        new string[128], Index; tmp0 = strtok(params, Index); tmp2 = strtok(params, Index); tmp3 = strtok(params, Index);
        if(isnull(tmp0) || isnull(tmp2) || !strilen(tmp3)) return SP -1 "Usage: /vl [X], [Y], [Z]");
        x = strval(tmp0);           y = strval(tmp2);            z = strval(tmp3);
        CMDMessageToAdmins(playerid, "VL");
        SetVehicleVelocity(GetPlayerVehicleID(playerid)), x, +y, +z);
        SP blue, "Happy flying");
    }
    else return SendClientMessage(playerid, red, "[ERROR]: You are not a high enough level to use this command");
}
Reply
#3

new tmp0[256]

maybe that?
Reply
#4

Ok fixed those errors, now i got these:

C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : error 001: expected token: ",", but found "-string-"
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : warning 215: expression has no effect
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : error 001: expected token: ";", but found ")"
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : error 029: invalid expression, assumed zero
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12720) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Line 12720 = if(isnull(tmp0) || isnull(tmp2) || !strlen(tmp3)) return SP -1 "Usage: /vl [X], [Y], [Z]");
Reply
#5

Try this:
pawn Код:
CMD:vl(playerid)
{
    if(PlayerInfo[playerid][Level] >=5 || IsPlayerAdmin(playerid))
    {
        if(Admin[playerid] == 0) return SP COLOR_RED, "You're not on duty");
        if(!IsPlayerInAnyVehicle(playerid)) return SP COLOR_RED, "You need to be in a vehicle");
        new Float:VLX, Float:VLZ, FloatVLY;
        new tmp0[256], tmp1[256], tmp2[256], tmp3[256];
        new string[128], Index; tmp0 = strtok(params, Index); tmp2 = strtok(params, Index); tmp3 = strtok(params, Index);
        if(isnull(tmp0) || isnull(tmp2) || !strilen(tmp3)) return SP -1, "Usage: /vl [X], [Y], [Z]");
        x = strval(tmp0);           y = strval(tmp2);            z = strval(tmp3);
        CMDMessageToAdmins(playerid, "VL");
        SetVehicleVelocity(GetPlayerVehicleID(playerid)), x, +y, +z);
        SP blue, "Happy flying");
    }
    else return SendClientMessage(playerid,red, "[ERROR]: You are not a high enough level to use this command");
}
Reply
#6

new string[128], Index; tmp0 = strtok(params,Index); tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);

Undefined symbols params..

:S

Tmp1 doesn't exist.
Reply
#7

CMD:vl(playerid)
to
CMD:vl(playerid, params[])

EDIT:
pawn Код:
CMD:vl(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >=5 || IsPlayerAdmin(playerid))
    {
        if(Admin[playerid] == 0) return SP COLOR_RED, "You're not on duty");
        if(!IsPlayerInAnyVehicle(playerid)) return SP COLOR_RED, "You need to be in a vehicle");
        new Float:VLX, Float:VLZ, FloatVLY;
        new tmp1[256], tmp2[256], tmp3[256];
        new string[128], Index; tmp0 = strtok(params, Index); tmp2 = strtok(params, Index); tmp3 = strtok(params, Index);
        if(isnull(tmp1) || isnull(tmp2) || !strilen(tmp3)) return SP -1, "Usage: /vl [X], [Y], [Z]");
        x = strval(tmp1);           y = strval(tmp2);            z = strval(tmp3);
        CMDMessageToAdmins(playerid, "VL");
        SetVehicleVelocity(GetPlayerVehicleID(playerid)), x, +y, +z);
        SP blue, "Happy flying");
    }
    else return SendClientMessage(playerid,red, "[ERROR]: You are not a high enough level to use this command");
    return 1;
}
Reply
#8

now this...

C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12756) : error 017: undefined symbol "z"
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : warning 202: number of arguments does not match definition
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : warning 202: number of arguments does not match definition
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : warning 202: number of arguments does not match definition
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : warning 215: expression has no effect
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : error 029: invalid expression, assumed zero
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : warning 215: expression has no effect
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : error 029: invalid expression, assumed zero
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : error 017: undefined symbol "z"
C:\Users\Guille\Desktop\Samp scripting\Server23\Server\gamemodes\WD.pwn(12758 ) : fatal error 107: too many error messages on one line


SetVehicleVelocity line .-. and z thing :/
Reply
#9

pawn Код:
SetVehicleVelocity(GetPlayerVehicleID(playerid)), x, +y, +z);
to
pawn Код:
SetVehicleVelocity(GetPlayerVehicleID(playerid), x, +y, +z);
EDIT:
pawn Код:
CMD:vl(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >=5 || IsPlayerAdmin(playerid))
    {
        if(Admin[playerid] == 0) return SP COLOR_RED, "You're not on duty");
        if(!IsPlayerInAnyVehicle(playerid)) return SP COLOR_RED, "You need to be in a vehicle");
        new Float:VLX, Float:VLZ, Float:VLY;
        new tmp1[256], tmp2[256], tmp3[256];
        new string[128], Index; tmp0 = strtok(params, Index); tmp2 = strtok(params, Index); tmp3 = strtok(params, Index);
        if(isnull(tmp1) || isnull(tmp2) || !strilen(tmp3)) return SP -1, "Usage: /vl [X], [Y], [Z]");
        VLX = strval(tmp1);        VLY = strval(tmp2);          VLZ = strval(tmp3);
        CMDMessageToAdmins(playerid, "VL");
        SetVehicleVelocity(GetPlayerVehicleID(playerid)), VLX, + VLY, + VLZ);
        SP blue, "Happy flying");
    }
    else return SendClientMessage(playerid,red, "[ERROR]: You are not a high enough level to use this command");
    return 1;
}
Reply
#10

Fixed thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)