• Welcome to Vice City Multiplayer.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - bilakispa

#1
mIRC/pawn Scripting / Re: [pawn] Dcmd command errors
March 04, 2010, 10:23:38 PM
if (!strcmp(cmd, "!fix", true))
{
if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle");
if (GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_RED, "You can't fix the vehicle as a passeger");
new vehicleid=GetPlayerVehicleID(playerid);
GetVehiclePos(vehicleid, x, y, z);
GetPlayerFacingAngle(playerid, rot);
SetVehiclePos(vehicleid, x, y, z, rot);
SetVehicleHealth(vehicleid, 1000.0);
    SetVehicleTyre(vehicleid, 1);
SetVehicleLights(vehicleid, 1);
return SendClientMessage(playerid, COLOR_GREEN, "Car fixed!");
}

Nevermind, putted strcmp.

But, does SetVehiclePos() works for you?
I've tried lots of ways but SetVehiclePos() doesn't work.
#2
mIRC/pawn Scripting / [pawn] Dcmd command errors
March 03, 2010, 10:32:37 PM
Aww, damn it! I can't find what's wrong with this. (Note: I have defined dcmd.)

public OnPlayerCommandText(playerid, cmdtext[])
{
     dcmd(fix,3,cmdtext); //<--------- LINE 67
     ...other commands..
     return 0;
}

dcmd_fix(playerid, params[])
{
#pragma unused params
if (!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle");
else
{
if (GetPlayerState(playerid) == 2)
{
int vehicleid=GetPlayerVehicleID(playerid); float x,y,z;
RemovePlayerFromVehicle(playerid);
GetVehiclePos(vehicleid, x, y, z);
SetVehicleToRespawn(vehicleid);
SetVehiclePos(vehicleid, x, y, z, 0);
PutPlayerInVehicle(playerid, vehicleid);
}
else SendClientMessage(playerid, COLOR_RED, "You can't fix the vehicle as a passenger");
}
return 1;
}


Compiler Output:
C:\Program Files\Rockstar Games\GTA Vice City - Server\gamemodes\mode.pwn(67) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA Vice City - Server\gamemodes\mode.pwn(67) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA Vice City - Server\gamemodes\mode.pwn(67) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA Vice City - Server\gamemodes\mode.pwn(67) : error 001: expected token: ";", but found ")"
C:\Program Files\Rockstar Games\GTA Vice City - Server\gamemodes\mode.pwn(67) : fatal error 107: too many error messages on one line



Also, shouldn't be a GetVehicleRot Function for the vehicle rotation?
#3
mIRC/pawn Scripting / Re: pawn commands
March 02, 2010, 05:40:40 PM
Quote from: Ettans on February 28, 2010, 02:38:40 PM
zcmd would be the fastest of those.
Indeed, but in this version it doesn't support CallLocalFunction, you will have compiler errors.

Dcmd is fast too, learn it
#4
mIRC/pawn Scripting / Re: Problem...
March 02, 2010, 01:06:09 PM
Quote from: Ettans on March 01, 2010, 06:47:20 PM
We can't give you an example. Does the compiler give you any errors or warnings? Copy paste the log.