CMD:vl(playerid, params[])
{
if(PlayerInfo[playerid][Level] >=5 || IsPlayerAdmin(playerid))
{
if(PlayerInfo[playerid][OnDuty] == 0) return SCM(playerid, C_RED, "You're not on duty");
if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, C_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; tmp1 = strtok(params, Index); tmp2 = strtok(params, Index); tmp3 = strtok(params, Index);
if(isnull(tmp1) || isnull(tmp2) || isnull(tmp3)) return SCM(playerid, C_RED, "Usage: /vl [X], [Y], [Z]");
VLX = strval(tmp1); VLY = strval(tmp2); VLZ = strval(tmp3);
SetVehicleVelocity(GetPlayerVehicleID(playerid), VLX, + VLY, + VLZ); //Line 10364 o.o
}
else return SendClientMessage(playerid,red, "[ERROR]: You are not a high enough level to use this command");
return 1;
}
D:\San Andreas\A Script Folder\gamemodes\asdfaa.pwn(10364) : error 029: invalid expression, assumed zero D:\San Andreas\A Script Folder\gamemodes\asdfaa.pwn(10364) : warning 215: expression has no effect D:\San Andreas\A Script Folder\gamemodes\asdfaa.pwn(10364) : error 029: invalid expression, assumed zero D:\San Andreas\A Script Folder\gamemodes\asdfaa.pwn(10364) : warning 215: expression has no effect D:\San Andreas\A Script Folder\gamemodes\asdfaa.pwn(10364) : error 001: expected token: ";", but found ")" D:\San Andreas\A Script Folder\gamemodes\asdfaa.pwn(10364) : fatal error 107: too many error messages on one line
SetVehicleVelocity(GetPlayerVehicleID(playerid), VLX, VLY, VLZ);
What are you trying to do with '+' symbol?
pawn Код:
|
new tmp1[256], tmp2[256], tmp3[256];
new string[128]
Can I also suggest you something? It's better to use sscanf for splitting the string (for the parameters) because strtok is really bad. Also take a look here:
pawn Код:
|