26.10.2012, 14:52
Hi, i made this really quick just to see if it works:
It always says not you car even after ive used buy car
pawn Code:
CMD:buycar(playerid, params[])
{
new vehicle;
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if(sscanf(params,"i",vehicle)) return SendClientMessage(playerid, -1, "use /buycar");
VehInfo[vehicle][Owner] = PlayerName(playerid);
VehInfo[vehicle][modelid] = vehicle;
VehInfo[vehicle][carid] = CreateVehicle(vehicle, X, Y, Z, A, 0, 1, -1);
return 1;
}
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new name[24];
GetPlayerName(playerid, name, 24);
if(!strcmp(name,VehInfo[vehicleid][Owner]))
{
SendClientMessage(playerid, -1, "not ur car");
}
else
{
SendClientMessage(playerid, -1, "welcome to your car");
}
return 1;
}