24.05.2011, 20:39
Hola a todos quisiera saver como crear comando de /lock y /unlock para autos
Gracias.
Gracias.
new VehiculoCerrado[MAX_VEHICLES];
if(strcmp(cmdtext, "/lock", true) == 0)
{
new
vehiculo = GetPlayerVehicleID(playerid);
{
if(!IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, ROJO, "No estбs en un vehнculo.");
}
if(GetPlayerVehicleSeat(playerid) != 0)
{
return SendClientMessage(playerid, ROJO, "Necesitas ser el conductor para cerrar el auto.");
}
if(VehiculoCerrado[vehiculo] == 1)
{
return SendClientMessage(playerid, ROJO, "Tu auto ya estб cerrado.");
}
for(new i = 0;i < MAX_PLAYERS; i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(vehiculo, i, 0, 1);
}
}
VehiculoCerrado[vehiculo] = 1;
}
return 1;
}
if(strcmp(cmdtext, "/unlock", true) == 0)
{
new
vehiculo = GetPlayerVehicleID(playerid);
{
if(!IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, ROJO, "No estбs en un vehнculo.");
}
if(GetPlayerVehicleSeat(playerid) != 0)
{
return SendClientMessage(playerid, ROJO, "Necesitas ser el conductor para abrir el auto.");
}
if(VehiculoCerrado[vehiculo] == 0)
{
return SendClientMessage(playerid, ROJO, "Tu auto ya estб abierto.");
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(vehiculo, i, 0, 0);
}
}
VehiculoCerrado[vehiculo] = 0;
}
return 1;
}
new
vehiculo = GetPlayerVehicleID(playerid);
if(VehiculoCerrado[vehiculo] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(vehiculo, i, 0, 0);
}
VehiculoCerrado[vehiculo] = 0;
}
for(new x = 0; x < MAX_PLAYERS; x++) {
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && SpecID[x] == playerid) {
PlayerSpectatePlayer(x, playerid);
}
}
return 1;
}
VehiculoCerrado[vehiculo] = 0;
Y en OnPlayerExitVehicle...
pawn Код:
pawn Код:
|
C:\Documents and Settings\BlackCrystal™\Escritorio\CNR.pwn(7575) : error 017: undefined symbol "SpecID"
C:\Documents and Settings\BlackCrystal™\Escritorio\CNR.pwn(7575) : warning 215: expression has no effect
C:\Documents and Settings\BlackCrystal™\Escritorio\CNR.pwn(7575) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\BlackCrystal™\Escritorio\CNR.pwn(7575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BlackCrystal™\Escritorio\CNR.pwn(7575) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
new SpecID[MAX_PLAYERS];
C:\Documents and Settings\BlackCrystal™\Escritorio\CNR.pwn(7582) : error 010: invalid function or declaration C:\Documents and Settings\BlackCrystal™\Escritorio\CNR.pwn(7583) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
if(strcmp(cmdtext, "/lock", true) == 0)
{
new
vehiculo = GetPlayerVehicleID(playerid);
{
if(!IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, ROJO, "No estбs en un vehнculo.");
}
if(GetPlayerVehicleSeat(playerid) != 0)
{
return SendClientMessage(playerid, ROJO, "Necesitas ser el conductor para cerrar el auto.");
}
if(VehiculoCerrado[vehiculo] == 1)
{
return SendClientMessage(playerid, ROJO, "Tu auto ya estб cerrado.");
}
for(new i = 0;i < MAX_PLAYERS; i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(vehiculo, i, 0, 1);
}
}
VehiculoCerrado[vehiculo] = 1;
}
}
return 1;
}
No te pedimos el gm, te pedimos las lineas en las que te da el error, es como si dijera que te faltan 50 llaves en algo que no se ni que pasa.
pawn Код:
|
for(new x = 0; x < MAX_PLAYERS; x++) {
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && SpecID[x] == playerid) {
PlayerSpectatePlayer(x, playerid);
}
}