Im getting errors with a piece of code
#1

pawn Код:
(111)     if (GetVehicleModel(vehicleid)==CarInfo[i][ModelID] && CarInfo[i][OwnerName]!=PlayerName(playerid)) {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid,0xAA000AA,"Acces Denied!");
        }
errors :

Код:
(111) : error 033: array must be indexed (variable "PlayerName")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Use strcmp for comparing strings
https://sampwiki.blast.hk/wiki/Strcmp

pawn Код:
if (GetVehicleModel(vehicleid)==CarInfo[i][ModelID])
{
    if (strcmp(CarInfo[i][OwnerName], PlayerName(playerid)) != 0)
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid,0xAA000AA,"Acces Denied!");
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)