28.01.2011, 16:16
Hello, i need a little help with float vars :
Error :
On the top of the script :
Command:
FIXED :
Error :
pawn Код:
C:\Documents and Settings\Ivan\Desktop\mega-roleplay\gamemodes\M-RP.pwn(1688) : error 033: array must be indexed (variable "pCarSpawn")
C:\Documents and Settings\Ivan\Desktop\mega-roleplay\gamemodes\M-RP.pwn(1689) : error 033: array must be indexed (variable "pCarSpawn")
C:\Documents and Settings\Ivan\Desktop\mega-roleplay\gamemodes\M-RP.pwn(1690) : error 033: array must be indexed (variable "pCarSpawn")
C:\Documents and Settings\Ivan\Desktop\mega-roleplay\gamemodes\M-RP.pwn(1691) : error 033: array must be indexed (variable "pCarSpawn")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
pawn Код:
new Float:pCarSpawn[4][MAX_PLAYERS];
pawn Код:
if(strcmp(cmd, "/park", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(pCar[playerid] == 0)
{
SendClientMessage(playerid,COLOR_GREY," You don't own a car!");
return 1;
}
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GREY," You are not even inside a vehicle!");
return 1;
}
if(GetPlayerVehicleID(playerid) != pCar[playerid])
{
SendClientMessage(playerid,COLOR_GREY," You are not inside your car!");
return 1;
}
new Float:X, Float:Y, Float:Z, Float:angle;
GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
GetVehicleZAngle(GetPlayerVehicleID(playerid), angle);
pCarSpawn[0] = X;
pCarSpawn[1] = Y;
pCarSpawn[2] = Z;
pCarSpawn[3] = angle;
SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have parked your vehicle, It respawn here anytime now.");
return 1;
}
return 1;
}
pawn Код:
pCarSpawn[0] = X;
pCarSpawn[1] = Y;
pCarSpawn[2] = Z;
pCarSpawn[3] = angle;
changed with
pCarSpawn[0][playerid] = X;
pCarSpawn[1][playerid] = Y;
pCarSpawn[2][playerid] = Z;
pCarSpawn[3][playerid] = angle;